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 | |
| _command_prefix=${@:2} | |
| echo '<openbox_pipe_menu>' | |
| for i in `$1`; do | |
| echo "<item label=\"$i\">" | |
| echo '<action name="Execute">' | |
| echo "<command>$_command_prefix $i</command>" | |
| echo '</action>' | |
| echo '</item>' |
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
| import subprocess | |
| import shutil | |
| import os | |
| import sys | |
| import tarfile | |
| def get_version(project_root): | |
| process = subprocess.Popen( | |
| ['git', 'describe'], | |
| stdout=subprocess.PIPE, |
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
| makeTemplate = (path) -> | |
| i = 0 | |
| path.replace(/\*(\w)?/g, "{+raw#{i++}}$1") | |
| .replace(/:(\w+)/g, '{$1}') | |
| .replace(/List}/g, 's*}') | |
| uriTemplateMiddleware = (path='/') -> | |
| spec = null | |
| (req, res, next) -> | |
| if req.path == path |
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
| vows = require 'vows' | |
| assert = require 'assert' | |
| {mock, expect, lastCall, verify, pred, isDeep, any, verifyNoMore} = require './mtfw' | |
| suite = vows.describe('mtfw core').addBatch "A mock will": | |
| topic: -> mock() | |
| "be an object": (m) -> assert.isObject m | |
| "create new mocks when properties are accessed": -> | |
| m1 = mock() |
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
| // block-lambda proponents: what does this program do? | |
| function in_canadian (speak_cb) { | |
| add_eh = {|y| | |
| return y + ", eh?" | |
| } | |
| // now here comes a bunch of code. | |
| // imagine there are 50 lines here |
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
| inspect = require('util').inspect | |
| module.exports = function (config_path, opts) { | |
| var settings = { | |
| toJSON: function() { return this.__proto__ }, | |
| inspect: function() { return inspect(this.__proto__) }, | |
| } | |
| opts || (opts = {}) | |
| if (!opts.error) { |
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
| /** | |
| * A quick proof-of-concept of observable objects using JS accessors | |
| * | |
| * Base observable objects are created with * `new Observable(names)`, where | |
| * `names` is an array of property names that should be observable. | |
| * | |
| * Instances are created by calling .create(initial_data) on the resulting | |
| * base object, and observed with their .observe(handler) method. See the bottom | |
| * of this file for an example. | |
| */ |
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
| macro $do { | |
| case ($($x = $y) (,) ...) $body => { | |
| (function ($x (,) ...) $body)($y (,) ...) | |
| } | |
| case $name ($($x = $y) (,) ...) $body => { | |
| (function $name ($x (,) ...) $body)($y (,) ...) | |
| } | |
| } | |
| macro $var { |
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
| DROP DATABASE IF EXISTS stupid_simple_test; | |
| CREATE DATABASE stupid_simple_test; | |
| USE stupid_simple_test; | |
| CREATE TABLE users ( | |
| id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| email VARCHAR(255) NOT NULL, | |
| password VARCHAR(255) -- Should be properly encrypted in a real application! |
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
| chdir(/usr/local/Cellar/macvim/7.3-66/MacVim.app/Contents/Resources/vim) | |
| fchdir() to previous dir | |
| sourcing "$VIM/vimrc" | |
| finished sourcing $VIM/vimrc | |
| chdir(/Users/stephen) | |
| fchdir() to previous dir | |
| sourcing "$HOME/.vimrc" | |
| Searching for "ftoff.vim" in "/Users/stephen/.vim,/usr/local/Cellar/macvim/7.3-66/MacVim.app/Contents/Resources/vim/vimfiles,/usr/local/Cellar/macvim/7.3-66/MacVim.app/Contents/Resources/vim/runtime,/usr/local/Cellar/macvim/7.3-66/MacVim.app/Contents/Resources/vim/vimfiles/after,/Users/stephen/.vim/after" | |
| Searching for "/Users/stephen/.vim/ftoff.vim" |
OlderNewer