This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// namespace | |
window.MyApp = {}; | |
// define namespace | |
MyApp.define = function(name, fn) { | |
var parent = MyApp; | |
var parts = name.split('.'); | |
parts.forEach(function(part, i) { | |
var isLast = parts.length === i + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// expressで/public以下だけbasic認証外したい場合 | |
var basicAuth = express.basicAuth(user, password); | |
app.use(function(req, res, next) { | |
if (/^\/public\//.test(req.path)) { | |
next(); | |
} | |
else { | |
basicAuth(req, res, next); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Sample Propane caveatPatchor.js file based on tmm1's avatar hack. | |
You'll need at least version 1.1.1 to experiment with this: | |
http://propaneapp.com/appcast/Propane.1.1.1.zip | |
Once I'm sure exposing this hack-injection point doesn't cause problems | |
I'll do an official auto-updating version. | |
As of version 1.1.1, Propane will load and execute the contents of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo ' | |
___ | |
/ /\ ___ ___ | |
/ /:/_ / /\ / /\ | |
/ /:/ /\ / /:/ / /:/ | |
/ /:/_/::\ /__/::\ / /:/ | |
/__/:/__\/\:\ \__\/\:\__ / /::\ | |
\ \:\ /~~/:/ \ \:\/\ /__/:/\:\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var origSet = Backbone.Model.prototype.set; | |
Backbone.Model.prototype.set = function(key, value, options) { | |
var attrs, attr, val; | |
if (_.isObject(key) || key == null) { | |
attrs = key; | |
options = value; | |
} else { | |
attrs = {}; | |
attrs[key] = value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# modules | |
# | |
fs = require 'fs' | |
{exec} = require 'child_process' | |
# | |
# options | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef nodebrew | |
_sub_commands install uninstall use list ls ls-remote ls-all clean selfupdate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" タブの設定を切り替えのトグル | |
function! TabToggle() | |
fun! l:Set1() | |
setlocal softtabstop=2 | |
setlocal shiftwidth=2 | |
setlocal expandtab | |
endfun | |
fun! l:Set2() | |
setlocal softtabstop=4 | |
setlocal shiftwidth=4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* File watch and exec command cli tool. | |
* | |
* Example | |
* | |
* $ watcher *.less -- lessc style.less style.css | |
* | |
*/ |