Skip to content

Instantly share code, notes, and snippets.

View ducksoupdev's full-sized avatar

Matt Levy ducksoupdev

View GitHub Profile
Install homebrew
Install Git and bash-completion: brew install git bash-completion
Add bash-completion to your .bash_profile:
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
@ducksoupdev
ducksoupdev / happy_git_on_osx.md
Created October 10, 2016 18:47 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@ducksoupdev
ducksoupdev / New-SymLink.ps1
Created July 21, 2016 11:50
New symlink in Powershell
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@ducksoupdev
ducksoupdev / sssl.js
Created July 4, 2016 11:52 — forked from aFarkas/sssl.js
simple, small script loader
/*!
* SSSL: smallest, simpelst script loader
* version: 1.0.1
*
* API:
* Normal usage
* sssl(source [,complete]);
*
* Example:
* sssl('jquery.js', function(){
@ducksoupdev
ducksoupdev / logging.js
Created June 30, 2016 12:00
A simple node module that makes console.log/error/warn/debug statements log through winston (simply include at the beginning of your app)
'use strict';
var util = require('util'),
winston = require('winston'),
logger = new winston.Logger(),
production = (process.env.NODE_ENV || '').toLowerCase() === 'production';
module.exports = {
middleware: function(req, res, next){
console.info(req.method, req.url, res.statusCode);
@ducksoupdev
ducksoupdev / postal.d.ts
Created June 16, 2016 11:43
Postal.js Typescript definitions
// Type definitions for PostalJS
// Project: https://github.com/postaljs/postal.js
// Definitions By: Bart Breen (https://github.com/barticus)
interface PostalEnvelope {
channel?: string;
topic: string;
timeStamp?: any;
data?: any;
}
@ducksoupdev
ducksoupdev / eventemitter.js
Last active April 8, 2016 12:58 — forked from mudge/eventemitter.js
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@ducksoupdev
ducksoupdev / XHR.ts
Created March 15, 2016 10:17
Custom XHR wrapper with JSON parser
import {Promise} from "es6-promise";
export class Header {
header: string;
data: string;
constructor(header: string, data: string) {
this.header = header;
this.data = data;
}
}
@ducksoupdev
ducksoupdev / example.html
Created March 2, 2016 19:39 — forked from schmuli/example.html
A simple AngularJS service for handling the 'onbeforeunload' event
<!DOCTYPE html>
<html data-ng-app="TestApp">
<head>
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<script>
angular.module('TestApp', [])
.factory('beforeUnload', function ($rootScope, $window) {
// Events are broadcast outside the Scope Lifecycle