Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Montgomery jimmont

View GitHub Profile
View Git push deployment in 7 easy steps.md

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 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) {
return;
}
peeked = true;
var stream = this;
var cont = function (end) {
@dexygen
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
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
hallahan / featuresAt-mapbox-gl-js.md
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.
View featuresAt-mapbox-gl-js.md

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.

featuresat.html

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

map.on('click', function(e) {
View css-system-fonts.css
/* 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 Nov 21, 2016
SERVER: nginx & apache - Enable Gzip & future headers + disable etags
View Optimize-nginx.md
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
formigarafa / Google-DNS-over-HTTPS.md
Last active Mar 15, 2017
Basic to get google dns over https working.
View Google-DNS-over-HTTPS.md
You can’t perform that action at this time.