Skip to content

Instantly share code, notes, and snippets.

View shawndumas's full-sized avatar

Shawn Dumas shawndumas

View GitHub Profile
@samnang
samnang / gist:1759336
Created February 7, 2012 11:52
Install Bash version 4 on MacOS X
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
@donnut
donnut / .vimrc
Created February 24, 2012 19:17
Vim script to convert jasmine test file to qunit
"add this to .vimrc
source ~/dev/jasmine2qUnit/jasmine2qUnit.vim
nmap ;q :call ConvertJasmineTest2qUnit()<CR>
@utsengar
utsengar / Sync_Async_loading_handlebars.js
Created April 2, 2012 20:41
synchronous and asynchronous loading of handlebars templates
/*
* This decorates Handlebars.js with the ability to load
* templates from an external source, with light caching.
*
* To render a template, pass a closure that will receive the
* template as a function parameter, eg,
* T.render('templateName', function(t) {
* $('#somediv').html( t() );
* });
* Source: https://github.com/wycats/handlebars.js/issues/82
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active July 10, 2024 14:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@thomasboyt
thomasboyt / grunt.js
Created February 10, 2014 23:44
Side-by-side comparison of Grunt and Gulp configuration. Only significant difference is that `gulp-concat` doesn't generate source maps like `grunt-concat-sourcemaps`.
/* jshint node: true */
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
transpile: {
main: {
type: 'amd',
moduleName: function(path) {
@alanpeabody
alanpeabody / .projections.json
Last active August 29, 2015 13:56
Ember App Kit & vim-projectile
{
"app/models/*.js": {
"command": "model",
"template": [ "export default DS.Model.extend({", "});" ]
},
"app/router.js": { "command": "router"},
"app/routes/*.js": {
"command": "route",
"template": [ "export default Ember.Route.extend({", "});" ],
"alternate": "app/controllers/%s.js"
@dagda1
dagda1 / union.js
Last active August 29, 2015 13:58
App.computed.union = function() {
var args, options, properties;
properties = a_slice.call(arguments);
args = properties.map((function(_this) {
return function(prop) {
return "" + prop;
};
})(this));
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing