Skip to content

Instantly share code, notes, and snippets.

View neworldwebsites's full-sized avatar

Gilles Blanchard neworldwebsites

View GitHub Profile

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@neworldwebsites
neworldwebsites / webdev_online_resources.md
Created July 16, 2018 18:08 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@neworldwebsites
neworldwebsites / dt-regex-basics-2.js
Created June 23, 2018 00:03 — forked from chhib/dt-regex-basics-2.js
Companion Code to DevTips Capture Groups & Alternation
// Classic first/last name switcharoo regex replace example
let firstThenLast = "Zara Larsson"
let getFirstAndLast = /(\w+) (\w+)/
firstThenLast.match(getFirstAndLast) //?
let lastCommaFirst = firstThenLast.replace(getFirstAndLast, "$2, $1") //?
// Capturing parentheses
let message = "MPJ hosts DevTips"
let host = message.match(/(dah?vid|mpj) hosts devtips/i)[1] //?
@neworldwebsites
neworldwebsites / dt-regex-basics-2.js
Created June 23, 2018 00:03 — forked from chhib/dt-regex-basics-2.js
Companion Code to DevTips Capture Groups & Alternation
// Classic first/last name switcharoo regex replace example
let firstThenLast = "Zara Larsson"
let getFirstAndLast = /(\w+) (\w+)/
firstThenLast.match(getFirstAndLast) //?
let lastCommaFirst = firstThenLast.replace(getFirstAndLast, "$2, $1") //?
// Capturing parentheses
let message = "MPJ hosts DevTips"
let host = message.match(/(dah?vid|mpj) hosts devtips/i)[1] //?
@neworldwebsites
neworldwebsites / tweetjam.md
Created April 6, 2018 01:14 — forked from kometbomb/tweetjam.md
PICO-8 tweetjam stuff

PICO-8 size optimization stuff

Here are some simple ways to make your PICO-8 code fit in 140 characters (as in the tweetjam craze). I did not invent these, I merely observed and collected them from the tweetjam thread.

LUA syntax stuff

  • Use single character variable names
  • Use x=.1 and x=.023, not x=0.1 or x=0.023
  • x=1/3 is shorter than x=.3333
  • You don't need to separate everything with spaces or write them on their own lines, e.g. circ(x,y,1)pset(z,q,7) works just as well
@neworldwebsites
neworldwebsites / tweetjam.md
Created April 6, 2018 01:14 — forked from kometbomb/tweetjam.md
PICO-8 tweetjam stuff

PICO-8 size optimization stuff

Here are some simple ways to make your PICO-8 code fit in 140 characters (as in the tweetjam craze). I did not invent these, I merely observed and collected them from the tweetjam thread.

LUA syntax stuff

  • Use single character variable names
  • Use x=.1 and x=.023, not x=0.1 or x=0.023
  • x=1/3 is shorter than x=.3333
  • You don't need to separate everything with spaces or write them on their own lines, e.g. circ(x,y,1)pset(z,q,7) works just as well
/*
4.0.0-alpha.3
https://bootstrapcreative.com/resources/bootstrap-4-css-classes-index/
*/
.active
.alert
.alert-danger
.alert-dismissible
.alert-heading
.alert-info
@neworldwebsites
neworldwebsites / php.js
Created October 27, 2015 22:29
Emmet filter for PHP
emmet.require('filters').add('php', function process(tree) {
_.each(tree.children, function(node) {
// define variable name
if (node.name() == 'data' && node.parent == ''){
node.start = '\\$this->request->data';
}else{
node.start = (node.parent == '' ? '\\$' : '') + node.name();