Skip to content

Instantly share code, notes, and snippets.

View matschaffer's full-sized avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
var sys = require('sys'),
buffer = '{"values":[1,2,3]}';
sys.p(JSON.parse(buffer));
sys.puts("Before values extension worked fine.");
require.paths.unshift('express/lib');
require('express');
sys.p(JSON.parse(buffer));
Sorry, there was an error.
No such file or directory - /Users/mat/code/redcar/plugins//textmate//vendor//redcar-bundles//Bundles//F-Script.tmbundle//Support/objc_completion.rb
/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:40:in `initialize'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:40:in `new'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:40:in `find_tags'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:36:in `each'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:36:in `find_tags'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:29:in `find_files'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:27:in `each'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:27:in `find_files'/Users/mat/code/redcar/plugins/redcar-todo/lib/todo_list/file_parser.rb:25:in `each'/Users/mat/code/redcar/plugins/redcar-to
require 'hoopla_salesforce/rake'
# You'll need to download your own WSDLs from the salesforce develop page
HooplaSalesforce.enterprise_wsdl = "lib/enterprise.xml"
HooplaSalesforce.metadata_wsdl = "lib/metadata.xml"
namespace :deploy do
HooplaSalesforce::Rake::DeployTask.new(:dev) do |t|
t.username = "dev username"
t.password = "dev password"
14:39 mat@schaffer: ~/code/kitty (master)
> /usr/bin/redcar
Redcar 0.3.9 ( universal-darwin10.0 )
Can't find jruby jar at /Library/Ruby/Gems/1.8/gems/redcar-0.3.9/lib/jruby-complete-1.5.1.jar, did you run 'redcar install' ?
def find_node_with_text(top, node_text)
node = top.detect { |node| node.text == node_text }
return node if node
find_node_with_text(top.children, node_text)
end
def camelize(first_letter_in_uppercase = true)
if first_letter_in_uppercase
gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
else
first.downcase + camelize(lower_case_and_underscored_word)[1..-1]
end
end
require 'rubygems'
require 'erubis'
class TemplateRunner
class OutputBuffer < String
alias :append= :<<
alias :safe_concat :<<
end
class Eruby < Erubis::Eruby
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.SWT;
public class SWTMenuDispose {
public static void main(String[] args) throws InterruptedException {
Thread.sleep(5000);
// Drives the Bieber-graph at http://awesometown.no.de.
// Run through a recent-ish version of node.js.
var sys = require('sys'),
http = require('http'),
twitter = http.createClient(80, 'search.twitter.com'),
twitterPath = "/search.json?&q=bieber",
chartId = "4c7a650eba12e9c41d000005",
interval = 5000,
lastId = null;
#!/bin/bash
while true; do
curl -d value=`uptime | cut -d':' -f3 | cut -d, -f1 | awk '{print $1}'` http://awesometown.no.de/graphs/4c7acd5ca121636840000002/appendValue
sleep 1
done