Skip to content

Instantly share code, notes, and snippets.

View jimmont's full-sized avatar

Jim Montgomery jimmont

View GitHub Profile

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 (example.com)

  1. Create a user on example.com, as which we (the git client) connects (push) to exmaple.com.
sudo useradd -m -s /usr/bin/git-shell git
@remy
remy / peek.js
Last active August 29, 2015 14:23
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?
var peek = module.exports = function (fn) {
var peeked = false;
return through(function write(data) {
this.emit('data', data);
if (peeked) {
return;
}
peeked = true;
var stream = this;
var cont = function (end) {
@dexygen
dexygen / meek.js
Last active December 20, 2015 03:09
Genuinely Unobtrusive Javascript
(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
clee / binary-plist.js
Created June 3, 2011 21:36
initial binary plist implementation in nodejs
#!/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 : ...
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
hallahan / featuresAt-mapbox-gl-js.md
Last active May 8, 2016 14:08
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) {
@philsinatra
philsinatra / css-system-fonts.css
Created October 29, 2015 13:41
CSS System Fonts
/* https://medium.com/@mwichary/system-shock-6b1dc6d6596f#.pth6mnqx0 */
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Oxygen", "Ubuntu", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
@facelordgists
facelordgists / Optimize-nginx.md
Last active November 21, 2016 12:01
SERVER: nginx & apache - Enable Gzip & future headers + disable etags
@giuliandrimba
giuliandrimba / git-empty-branch.txt
Created June 29, 2012 18:02
GIT: Create empty branch
git symbolic-ref HEAD refs/heads/empty
touch .gitignore
git add .gitignore
git commit -m 'Initial headless branch commit'
@formigarafa
formigarafa / Google-DNS-over-HTTPS.md
Last active March 15, 2017 08:15
Basic to get google dns over https working.