Skip to content

Instantly share code, notes, and snippets.

View timestep's full-sized avatar
:shipit:
I may be slow to respond.

Kevin timestep

:shipit:
I may be slow to respond.
View GitHub Profile
@timestep
timestep / cloudSettings
Last active December 8, 2018 16:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-08T16:28:24.522Z","extensionVersion":"v3.2.2"}
@timestep
timestep / iterm2-solarized.md
Created July 6, 2017 17:35 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

var makeErrorHandler = function (msg) {
//msg is the string passed via the call
//the return anonyumous function is what is passed back to the callback of getData
return function (error) {
sendErrorToServer(error);
showMessage(msg);
};
};
getData(query, function (result) {
var x = ['10','10','10'].map(parseInt);
//x === [10,Nan,2]
/*
map returns a callback with 3 arugments
arg[0] = elem;
arg[1] = index;
parseint takes 2 arguments
arg[0] = string;
//to use call getOrders.sum().then(function(sum){console.log(sum)});
angular.service('getOrders',function ($http,$q) {
return {
sum: function () {
var d = $q.defer();
//can add try method here
$http.get('/orders').success(function (data) {
//assuming data is just json array of orders.
var orders = data;
var sumOfOrders = 0;
Steps:
0. Checkout your git repo from the server
1. Upload both of these files to the same directory on your server
2. chmod +x restart_node.sh
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log &
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/
5. Make a commit to your repo
6. Point a browser at http://<your host>:8080/ and you should see the commit
@timestep
timestep / citysample
Created November 17, 2014 18:23
city sample data
Country,City,AccentCity,Region,Population,Latitude,Longitude
ad,aixas,Aixàs,06,,42.4833333,1.4666667
ad,aixirivali,Aixirivali,06,,42.4666667,1.5
ad,aixirivall,Aixirivall,06,,42.4666667,1.5
ad,aixirvall,Aixirvall,06,,42.4666667,1.5
ad,aixovall,Aixovall,06,,42.4666667,1.4833333
ad,andorra,Andorra,07,,42.5,1.5166667
ad,andorra la vella,Andorra la Vella,07,20430,42.5,1.5166667
ad,andorra-vieille,Andorra-Vieille,07,,42.5,1.5166667
ad,andorre,Andorre,07,,42.5,1.5166667
/*! Socket.IO.min.js build:0.9.16, production. Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed */
var io="undefined"==typeof module?{}:module.exports;(function(){(function(a,b){var c=a;c.version="0.9.16",c.protocol=1,c.transports=[],c.j=[],c.sockets={},c.connect=function(a,d){var e=c.util.parseUri(a),f,g;b&&b.location&&(e.protocol=e.protocol||b.location.protocol.slice(0,-1),e.host=e.host||(b.document?b.document.domain:b.location.hostname),e.port=e.port||b.location.port),f=c.util.uniqueUri(e);var h={host:e.host,secure:"https"==e.protocol,port:e.port||("https"==e.protocol?443:80),query:e.query||""};c.util.merge(h,d);if(h["force new connection"]||!c.sockets[f])g=new c.Socket(h);return!h["force new connection"]&&g&&(c.sockets[f]=g),g=g||c.sockets[f],g.of(e.path.length>1?e.path:"")}})("object"==typeof module?module.exports:this.io={},this),function(a,b){var c=a.util={},d=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev