Skip to content

Instantly share code, notes, and snippets.

View codebymikey's full-sized avatar

codebymikey codebymikey

View GitHub Profile
@bobbybouwmann
bobbybouwmann / User.php
Last active May 31, 2024 03:04
Laravel Absolute vs Relative Dates with Carbon
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
@scrapehero
scrapehero / geocoder.py
Created March 30, 2017 07:57
Python script to parse unstructured addresses
from requests import get
from pprint import pprint
from json import dump
from csv import QUOTE_ALL, DictWriter
API_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def address_resolver(json):
final = {}
if json['results']:
data = json['results'][0]
for item in data['address_components']:
@bennadel
bennadel / test.js
Created May 31, 2017 12:11
The Chalk Module Can Be Used With The Console's String Interpolation In Node.js
// Require the core node modules.
var chalk = require( "chalk" );
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
// The approach that I normally use when nesting styles is to include a variable
// number of arguments in the root chalk() call. This allows the styles to build upon
// each other.
// --
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active September 4, 2026 14:33
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@almoore
almoore / nodeApp.service
Created December 18, 2017 03:59
Systemd node start script
[Unit]
Description=hello_env.js - making your environment variables rad
Documentation=https://example.com
After=network.target
[Service]
Environment=NODE_PORT=3001
Type=simple
User=root
ExecStart=/usr/bin/node /home/ubuntu/hello_env.js
@tpaksu
tpaksu / renew.sh
Created January 19, 2018 07:35
laragon refresh certificates
#!/bin/sh
CRTPATH=$(pwd -W)
for i in *.key ; do
DOMAIN=${i%.key}
cat << EOF > openssl_$DOMAIN.conf
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
@aristidesneto
aristidesneto / install.sh
Created January 22, 2018 20:04
PHP-MariaDB
apt-get update
apt-get install ca-certificates -y
echo "deb http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
echo "deb-src http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
echo "deb http://mirror.edatel.net.co/mariadb/repo/10.1/debian jessie main" >> /etc/apt/sources.list
echo "deb-src http://mirror.edatel.net.co/mariadb/repo/10.1/debian jessie main" >> /etc/apt/sources.list
wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
@dikiaap
dikiaap / git-io-custom-url.md
Last active November 26, 2025 10:21
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@zgordon
zgordon / gutenberg-webpack-config-with-externals.js
Last active November 19, 2021 12:25
An example of a webpack config for Gutenberg block development using externals
/**
* External dependencies
*/
// Load webpack for use of certain webpack tools and methods
const webpack = require( 'webpack' );
// For extracting CSS (and SASS) into separate files
const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
// Main CSS loader for everything but blocks..