Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Not your keys, not your coins.

Steven Black StevenBlack

🤔
Not your keys, not your coins.
View GitHub Profile
View nodejs-cheatsheet.js
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
View gist:170202c0c25c3928d5ecc34c5df9b540
Standups:
2-3 times per night
post issues to Slack
designate scrum master and rotate who the master will be
scrum master gives everyone a turn to speak
Conflicts:
Write down your conflict
Spend 15 minutes tops to resolve the conflict and move on.
We are all on the same team with the same goal
View jsonball.rb
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
#
# where TYPE is one of {data,var,file,page}, described below
View Agou setup
- [ ] Install ITerm2 app – https://www.iterm2.com/
- [ ] Install Sublime Text app – https://www.sublimetext.com/ and the `subl` command line tool
- [ ] Install MacDown app – http://macdown.uranusjr.com/
- [ ] Update Chrome to latest
- [ ] Install Chrome extension: Web Developer Toolbar
- [ ] Install Ruby Version Manager (RVM) – https://rvm.io/
- [ ] Install Ruby latest
- [ ] Install Jekyll (ruby Gem) – http://jekyllrb.com
- [ ] Create an account at https://github.com
- [ ] Install git
@StevenBlack
StevenBlack / better-nodejs-require-paths.md
Created Sep 23, 2016 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@StevenBlack
StevenBlack / sessionfactory.prg
Last active Jun 22, 2016
SessionFactory creates objects that are wrapped in a private data session. Note that the factory can die but its private datasession lives until all its products are out of scope.
View sessionfactory.prg
*=======================================
DEFINE CLASS SessionFactory AS Session
*=======================================
DataSession = 2 && private
*==========================
FUNCTION Init()
*==========================
SET CENTURY TO 20 ROLLOVER 50
SET CENTURY ON
@StevenBlack
StevenBlack / gist:4702345
Created Feb 3, 2013
Twitter search for Jekyll, the blog aware site generator
View gist:4702345
lang:en filter:links jekyll -rt -hyde -hide -movie -NBC -island -jekyll_hydee -jekyll_andhyde -jekyll_.{1-} -*\_jekyll -_Dr__Jekyll_ -Jekyll.{1-} -henry_jekyll -lemonade_jekyll -W{1-}jekyll -watching -jekyll_hyde96 -jackie_jekyll
@StevenBlack
StevenBlack / crosstab.sql
Created May 12, 2016 — forked from romansklenar/crosstab.sql
PostgreSQL "pivot table" example using tablefunc extension
View crosstab.sql
CREATE EXTENSION tablefunc;
CREATE TABLE sales(year int, month int, qty int);
INSERT INTO sales VALUES(2007, 1, 1000);
INSERT INTO sales VALUES(2007, 2, 1500);
INSERT INTO sales VALUES(2007, 7, 500);
INSERT INTO sales VALUES(2007, 11, 1500);
INSERT INTO sales VALUES(2007, 12, 2000);
INSERT INTO sales VALUES(2008, 1, 1000);
INSERT INTO sales VALUES(2009, 5, 2500);
View web-servers.md

Discussion on reddit.

Each of these commands will run an ad hoc http static file server in your current (or specified) directory. Use this power wisely.

Python 2.x

$ python -m SimpleHTTPServer 8000
@StevenBlack
StevenBlack / git.rb
Created Jun 2, 2013 — forked from alx/git.rb
Jekyll plugin to add Git activity inside a list
View git.rb
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
You can’t perform that action at this time.