Skip to content

Instantly share code, notes, and snippets.

View ryanburgess's full-sized avatar

Ryan Burgess ryanburgess

View GitHub Profile
@ryanburgess
ryanburgess / .vimrc
Created September 13, 2016 15:29
.vimrc
"--------------------
" vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
@ryanburgess
ryanburgess / state-province.json
Last active December 7, 2015 05:45
All the state and province names and two digit codes for USA and Canada.
[{
"value": "AK",
"state": "Alaska"
},
{
"value": "AL",
"state": "Alabama"
},
{
"value": "AB",
@ryanburgess
ryanburgess / province.json
Last active December 7, 2015 05:46
All province names and two digit province codes in Canada
[{
"value": "AB",
"state": "Alberta"
},
{
"value": "BC",
"state": "British Columbia"
},
{
"value": "MB",
@ryanburgess
ryanburgess / state.json
Last active December 7, 2015 05:46
All the state names and two digit state codes in USA
[{
"value": "AK",
"state": "Alaska"
},
{
"value": "AL",
"state": "Alabama"
},
{
"value": "AR",
@ryanburgess
ryanburgess / png.js
Created November 28, 2015 05:33
Example of console-png
var png = require('console-png');
var image = require('fs').readFileSync(__dirname + '/nodejs-green.png');
png(image, function (err, string) {
if (err) throw err;
console.log(string);
});
@ryanburgess
ryanburgess / scrape.js
Last active March 9, 2017 15:51
An example using Cheerio to scrape HTML
var cheerio = require('cheerio');
var request = require('request');
request({
method: 'GET',
url: 'http://www.wordthink.com'
}, function(err, response, body, callback) {
if (err) return console.error(err);
$ = cheerio.load(body);
@ryanburgess
ryanburgess / app.js
Last active February 18, 2019 07:57
Example API using Express and Cheerio.
var express = require('express');
var cheerio = require('cheerio');
var request = require('request');
var app = express();
var wordOfDay = [];
app.get('/', function (req, res) {
// allow access from other domains
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
@ryanburgess
ryanburgess / open-ports
Created March 18, 2015 22:15
Bash Shell Alias - show open ports
alias ports='netstat -tulanp'
@ryanburgess
ryanburgess / git-soft-reset
Created March 18, 2015 22:13
Bash Shell Alias - git soft reset
alias fix='git reset --soft HEAD~1'
@ryanburgess
ryanburgess / launch-iphone
Created March 18, 2015 22:12
Bash Shell Alias - launch iPhone simulator
alias iphone='open /Applications/Xcode.app/Contents/developer/applications/ios\ Simulator.app'