Skip to content

Instantly share code, notes, and snippets.

View stevenmaguire's full-sized avatar
:shipit:
Resolving those deltas...

Steven Maguire stevenmaguire

:shipit:
Resolving those deltas...
View GitHub Profile
@stevenmaguire
stevenmaguire / free_email_provider_domains.txt
Created January 11, 2018 00:29 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@stevenmaguire
stevenmaguire / nginx-config-directory.sh
Last active October 26, 2015 22:53
Get current nginx configuration directory from configure flags
#!/bin/bash
NGINX_CONFIG_DIRECTORY=$(2>&1 nginx -V | tr ' ' '\n' | grep -E -- '--conf-path=(.*)' | cut -d '=' -f 2 | sed -r 's/\/nginx\.conf//g')
# ALTERNATE
NGINX_CONFIG_DIRECTORY=$(nginx -V 2>&1 |tail -1|tr \ \\n|grep conf-path|tr = \\n|tail -1)

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine whose name is store in an env var $DOCKER_MACHINE_NAME.

Usage

http://git.io/vcj2P is a shortened url for the raw plist file.

DELIMITER ;
DROP FUNCTION IF EXISTS urldecode;
DELIMITER |
CREATE FUNCTION urldecode (s VARCHAR(4096)) RETURNS VARCHAR(4096)
DETERMINISTIC
CONTAINS SQL
BEGIN
DECLARE c VARCHAR(4096) DEFAULT '';
DECLARE pointer INT DEFAULT 1;
DECLARE h CHAR(2);
DELIMITER ;
DROP FUNCTION IF EXISTS urlencode;
DELIMITER |
CREATE FUNCTION urlencode (s VARCHAR(4096)) RETURNS VARCHAR(4096)
DETERMINISTIC
CONTAINS SQL
BEGIN
DECLARE c VARCHAR(4096) DEFAULT '';
DECLARE pointer INT DEFAULT 1;
DECLARE s2 VARCHAR(4096) DEFAULT '';
a
ii
about
above
according
across
39
actually
ad
adj
@stevenmaguire
stevenmaguire / laravel-nearby-locations-query-scope.php
Last active March 28, 2020 22:40
Laravel (Illuminate) query builder scope to list neighboring locations within a given distance from a given location
<?php
/**
* Query builder scope to list neighboring locations
* within a given distance from a given location
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param mixed $lat Lattitude of given location
* @param mixed $lng Longitude of given location
* @param integer $radius Optional distance
@stevenmaguire
stevenmaguire / ISBN10to13.sql
Last active May 31, 2023 12:18
MySQL function to convert ISBN10 to ISBN13
DROP FUNCTION IF EXISTS `ISBN10to13`;
delimiter //
CREATE FUNCTION `ISBN10to13`(isbn10 VARCHAR(50)) RETURNS varchar(50) CHARSET utf8
BEGIN
DECLARE isbn13 VARCHAR(13);
DECLARE i INT;
DECLARE chk INT;
IF (LENGTH(ISBN10) > 10) THEN
RETURN ISBN10;
@stevenmaguire
stevenmaguire / ISBN13to10.sql
Last active February 19, 2021 15:36
MySQL function to convert ISBN13 to ISBN10
DROP FUNCTION IF EXISTS `ISBN13to10`;
delimiter //
CREATE FUNCTION `ISBN13to10`(isbn13 VARCHAR(50)) RETURNS varchar(50) CHARSET utf8
BEGIN
DECLARE isbn10 VARCHAR(13);
DECLARE i VARCHAR(13);
DECLARE sum INT;
DECLARE chk INT;
DECLARE chkchar VARCHAR(3);