Skip to content

Instantly share code, notes, and snippets.

@stevebauman
stevebauman / RouteServiceProvider.php
Last active May 14, 2024 02:19
Throw exception on Eloquent model binding name mismatch
<?php
namespaced App\Providers;
use RuntimeException;
use Illuminate\Support\Facades\Route;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Routing\ImplicitRouteBinding;
class RouteServiceProvider extends ServiceProvider
@kailashbuki
kailashbuki / dcor.py
Last active May 14, 2024 02:18
Computes the distance correlation between two matrices in Python.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Computes the distance correlation between two matrices.
https://en.wikipedia.org/wiki/Distance_correlation
"""
import numpy as np
from scipy.spatial.distance import pdist, squareform
@projectoperations
projectoperations / Dockerfile
Created November 27, 2023 20:32 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@hirobert
hirobert / .env
Created January 10, 2019 00:45 — forked from schavery/.env
New Relic RQ setup
NEW_RELIC_LICENSE_KEY=6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5
NEW_RELIC_LOG=stdout
NEW_RELIC_APP_NAME=proj--staging
@joulgs
joulgs / terminal.txt
Last active May 14, 2024 02:15
How install libssl1.1 on ubuntu 22.04
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
@devded
devded / FileProcess.jsx
Created October 10, 2021 07:18
React json file download and upload. Export a json object and download as a json file. Import a json file and process in client side.
import React from "react";
const FileProcess = () => {
const jsonFileDownload = () => {
const json_data = {
name: "Dedar",
age: "14",
address: "House #28",
};
const fileName = "finename.json";
@qoomon
qoomon / conventional_commit_messages.md
Last active May 14, 2024 02:11
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@PhirePhly
PhirePhly / ISA.txt
Created March 26, 2012 20:42
Intro to the ISA bus by Mark Sokos
THE ISA AND PC/104 BUS
IBM, IBM/XT, IBM PC, and IBM PC AT are registered trademarks of
International Business Machines Corporation.
This file is designed to give a basic overview of the bus found in
most IBM clone computers, often referred to as the XT or AT bus. The
AT version of the bus is upwardly compatible, which means that cards
@projectoperations
projectoperations / localhost-https.md
Created October 21, 2023 01:53 — forked from kus/localhost-https.md
Local HTTPS server, generate SSL certificate

Chrome has decided that what they deem powerful web platform features such as Geolocation, Device motion / orientation, getUserMedia etc can no longer run on "Insecure Origins", HTTP (non-HTTPS) being one of them. Read more

So if you want to use these features in development and you are testing on a mobile via the IP of your computer, you now need to be serving the content over HTTPS for it to work.

Generate local SSL certificate

First check if you need to install openssl with which openssl. If nothing comes up run brew install openssl to install openssl with Brew.

openssl genrsa -des3 -passout pass:x -out localhost.pass.key 2048
openssl rsa -passin pass:x -in localhost.pass.key -out localhost.key
@lopspower
lopspower / README.md
Last active May 14, 2024 02:05
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store