Skip to content

Instantly share code, notes, and snippets.

View samtsai's full-sized avatar
🏠
Working from home

Sam Tsai samtsai

🏠
Working from home
View GitHub Profile
@aslansky
aslansky / gist:8741515
Created January 31, 2014 19:44
gulp livereload (gulp 3.5.0)
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var lr = require('tiny-lr');
var http = require('http');
var path = require('path');
var ecstatic = require('ecstatic');
var tlr = lr();
var livereload = function (evt, filepath) {
tlr.changed({
@epramono
epramono / ShareBibleVerse
Created March 9, 2014 13:18
This action will invoke the YouVersion.py in Pythonista, process the clipped verses from YouVersion's Bible app, and share it in any of the four modes. Requires: Launch Center Pro, Pythonista, YouVersion's Bible, Day One, and 1Writer.
pythonista://YouVersion?
action=run&
argv=[clipboard]&
argv=[list:Mode|
New MD Entry in Day One=1|
Append Sermon Notes in 1Writer=2|
Send as iMessage (with content)=3|
Send as iMessage (URL only)=4]
/* Original source: https://gist.github.com/oskarrough/914653b03d886c015320
* Modified fork: https://gist.github.com/consideRatio/761c6286158e70feaed7
*
* Working authentication with
* Firebase 2.0.x + Ember.js 1.8.1 + Ember Data Canary + EmberFire 1.3.0 + Ember CLI
* works for me! oskar@rough.dk
*
* Note: this assumes you've set up login on your Firebase,
* only handles Google and Facebook for now.
*
@jumski
jumski / backbone_sync_hack.coffee
Created August 5, 2011 17:10
BackboneJS sync hack to namespace params when saving/updating model
###
Usage:
* add model.name property that will be used as a namespace in the json request
* put this code before your Backbone app code
* use toJSON() as usual (so there is no namespacing in your templates)
* your model's data will be sent under model.name key when calling save()
###
# save reference to Backbone.sync
Backbone.oldSync = Backbone.sync
@jswartwood
jswartwood / index.html
Created January 6, 2012 14:30
Hiccup?
<!DOCTYPE html>
<html>
<body>
<p>These should output "last", "ok", then "all" for 10 promises and then another 10.</p>
<div id="out"></div>
<script type="text/javascript" src="https://raw.github.com/briancavalier/when.js/dev/when.js"></script>
<script type="text/javascript" src="main.js"></script>
</body>
</html>
@nicholascloud
nicholascloud / blog-npm-root-packages.md
Last active December 16, 2015 03:49
blog-npm-root-packages

The problem

When I list my npm packages with npm ls -g (or without the -g option for a local node_modules directory) I see all installed packages and their dependencies. Like so:

$ npm ls -g
├─┬ anvil.js@0.9.0-RC3.1
│ ├── colors@0.6.0
│ ├─┬ commander@1.1.1
│ │ └── keypress@0.1.0
@danbarua
danbarua / gist:5356062
Last active November 23, 2016 06:22 — forked from HasAndries/gist:3135128
AngularJs directive for Bootstrap datepicker
angular.module('bDatepicker', []).
directive('bDatepicker', function(){
return {
require: '?ngModel',
restrict: 'A',
link: function ($scope, element, attrs, controller) {
var updateModel, onblur;
if (controller != null) {
@cburgmer
cburgmer / validator-steps.py
Created April 17, 2011 13:52
Using Selenium to validate XHTML markup using lettuce
# -*- coding: utf-8 -*-
import re
from lettuce import world, step, before
from lettuce_webdriver.util import find_field
from lettuce_webdriver import webdriver # We need this to register "I visit..."
from nose.tools import assert_true
from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
@before.all
@phatblat
phatblat / heroku-node-init.sh
Created January 31, 2012 22:28
Bash script to initialize an OS X box for local development of node app on heroku
#!/bin/bash
NODE_VERSION=0.4.7
NPM_VERSION=1.0.94
# Save script's current directory
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#cd "${DIR}"
#
@fogus
fogus / oregon.bas
Created July 31, 2015 19:52
1975 version of Oregon Trail
8 REM MINNESOTA EDUCATIONAL COMPUTING CONSORTIUM STAFF
9 REM PROGRAMMING REVISIONS BY DON RAWITSCH - 1975
11 REM CURRENT VERSION - 3/27/75
15 REM **FOR THE MEANING OF THE VARIABLES USED, LIST LINES 4900-4960**
25 PRINT "DO YOU NEED INSTRUCTIONS (YES/NO)";
30 DIM C$[5]
35 INPUT C$
40 IF C$="NO" THEN 400
45 PRINT LIN(2)
59 REM ***INSTRUCTIONS***