Skip to content

Instantly share code, notes, and snippets.


Jim Montgomery jimmont

View GitHub Profile
View Git push deployment in 7 easy

How-to setup a simple git push deployment

These are my notes basically. I first created this just as a reminder for myself. Feel free to use this for your project as a starting point.

On the server (

  1. Create a user on, as which we (the git client) connects (push) to
sudo useradd -m -s /usr/bin/git-shell git
remy / peek.js
Last active Aug 29, 2015
Is this okay? The peek will just act as a benign through stream letting us see the first item. Would this add much overhead to the time do you think?
View peek.js
var peek = module.exports = function (fn) {
var peeked = false;
return through(function write(data) {
this.emit('data', data);
if (peeked) {
peeked = true;
var stream = this;
var cont = function (end) {
dexygen / meek.js
Last active Dec 20, 2015
Genuinely Unobtrusive Javascript
View meek.js
(function(scope) {
function destroyAutoGlobals(options) {
var allElements = document.getElementsByTagName("*"), elementId;
for (var i=allElements.length; i--; ) {
elementId = allElements[i].id;
if (elementId && window[elementId] instanceof HTMLElement) {
options && options.verbose && console.log('Destroying window["' + elementId + '"]');
window[elementId] = null;
clee / binary-plist.js
Created Jun 3, 2011
initial binary plist implementation in nodejs
View binary-plist.js
#!/usr/bin/env node
var fs = require('fs');
var sys = require('sys');
var bin = require('binary');
function bytesize(n) {
// JavaScript can't handle 64-bit ints natively.
// TODO: hack it up anyway.
// (n & 0xFFFFFFFF00000000) ? 8 : ...
View infinitescroll.js
app.directive('infiniteScroll', [
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) {
return {
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
elem.css('overflow-y', 'scroll');
elem.css('overflow-x', 'hidden');
elem.css('height', 'inherit');
scrollDistance = 0;
hallahan /
Last active May 8, 2016
I'm going through the code execution of `featuresAt` in Mapbox GL JS. This is to take notes and understand how all of this works.

How FeaturesAt Works in MapboxGL JS

I'm going through the code execution of featuresAt in Mapbox GL JS. This is to take notes and understand how all of this works.


Initiating the feature search based on the example on Mapbox GL API Docs...

map.on('click', function(e) {
View css-system-fonts.css
/* */
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Oxygen", "Ubuntu", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
facelordgists /
Last active Nov 21, 2016
SERVER: nginx & apache - Enable Gzip & future headers + disable etags
View git-empty-branch.txt
git symbolic-ref HEAD refs/heads/empty
touch .gitignore
git add .gitignore
git commit -m 'Initial headless branch commit'
formigarafa /
Last active Mar 15, 2017
Basic to get google dns over https working.
You can’t perform that action at this time.