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
# See: http://growl.info/documentation/applescript-support.php | |
# This is still pretty much voodoo to me | |
# | |
# The name argument specifies the name that will appear in the "Applications" | |
# tab of the Growl preferences pane. | |
def RBGrowl(name, title, body, icon = 'Console') | |
name, title, body, icon = [name, title, body, icon].map { |v| v.inspect } | |
ascript = %{tell application "GrowlHelperApp" | |
-- Make a list of all the notification types that this script will ever send: | |
set the allNotificationsList to {#{name}} |
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 ruby | |
# Save this to ~/bin/lns then never worry about the -s option and argument order | |
# for ln again | |
a,b = ARGV[0..1] | |
abort "provide source and dest, in any order" unless ARGV.size == 2 | |
if File.exist?(a) && File.exist?(b) | |
abort "both files exist" |
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
view.Person = function() { | |
var | |
root = $.n('div.person'), | |
api = {}, | |
ins = {}, | |
n = function() { return $.fn.n.apply(root, arguments) }; | |
// draw the view with the given attributes | |
api.init = function(attribs) { | |
n('form').n(function(n) { |
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 ruby | |
gems = File.read(ARGV[0] || 'app.rb').grep(/^gem/).map { |l| l.match(/gem\s+['"]([^'"]+?)['"],\s*['"]([^'"]+?)['"]/).captures } | |
gems_file = gems.map { |name,version| name + ' --version=' + version }.join("\n") + "\n" | |
File.open('.gems','w') { |f| f.write gems_file } | |
puts gems_file |
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
// FancyDomBuilder: | |
$.fn.n = function(builder) { | |
var self = this; | |
builder(function(str) { return $(str).appendTo(self) }); | |
return self; | |
}; | |
// with FancyDomBuilder: |
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
// FancyNodeBuilder | |
$ = (function(jquery) { | |
function jqueryWithFancyTagBuilder() { | |
if (arguments.length == 1 && isTagBuilderString(arguments[0])) | |
return jquery(compileTag(arguments[0])); | |
else | |
return jquery.apply(null, arguments); | |
} |
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
:style | |
body.examples > .example_item | |
:margin-top 200px | |
.example_item | |
:margin-top 20px | |
:position relative | |
input | |
:position absolute | |
:right 0 |
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
myles:Desktop myles$ mkdir tmp | |
myles:Desktop myles$ cd tmp/ | |
myles:tmp myles$ ls | |
myles:tmp myles$ ls | |
myles:tmp myles$ touch Server | |
myles:tmp myles$ touch Server2 | |
myles:tmp myles$ touch foo | |
myles:tmp myles$ ls | |
Server Server2 foo | |
myles:tmp myles$ ls [!Server]* |
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 $item = $('.item').remove(). | |
methods({ | |
load: function(attribs) { | |
this.set(attribs); | |
this.e.trigger('item:loaded',this); | |
return this; | |
}, | |
set: function(attribs) { | |
this.id = attribs.id; |
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
// global set by server | |
COMMENTS = [{'title': 'hello', 'body': 'im a lonley comment'}]; | |
// template & controller codez together as friends | |
html5(function(html) { | |
html.import('jquery'); | |
html.import('json'); | |
html.n('body', function(body) { |