Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
# usage: wake_me <command>
echo $@
$@
notification='display notification "'$@'" with title "Finished"'
osascript -e "$notification"
say -v Deranged "it's finally, finally finished. at last."
➜ ~ brew install freealut
==> Downloading http://connect.creativelabs.com/openal/Downloads/ALUT/freealut-1.1.0.tar.gz
curl: (6) Could not resolve host: connect.creativelabs.com
Trying a mirror...
==> Downloading http://ftp.de.debian.org/debian/pool/main/f/freealut/freealut_1.1.0.orig.tar.gz
######################################################################## 100.0%
==> Patching
patching file configure.ac
==> ./autogen.sh
@elisehuard
elisehuard / lark_template.rb
Created August 21, 2009 13:58
removing states and metric-fu for rails rumble
# download, from_repo, and commit_state methods swiped from
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
gem install hanna
def post(method_name, options = {}, body = nil)
request_body = body.blank? ? encode : body
if new?
# connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers)
# elise fix
connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers).tap do |response|
.id self= id_from_response(response)
load_attributes_from_response(response)
end
self
static VALUE
ossl_x509req_add_unstructuredName(VALUE self, VALUE name)
{
X509_REQ *req;
char* s;
GetX509Req(self,req);
s = StringValuePtr(name);
if (X509_REQ_add1_attr_by_NID(req, NID_pkcs9_unstructuredName,MBSTRING_ASC,s, -1) != 1) {
ossl_raise(eX509ReqError,NULL);
@elisehuard
elisehuard / gist:333827
Created March 16, 2010 10:30
awesome wm and rubymine
# add in .zshrc or .bashrc
# or in rubymine's startup script :)
export AWT_TOOLKIT='MToolkit java -jar weka.jar'
# helpers for local :javascripts and :stylesheets
# add
# yield :javascripts
# yield :stylesheets
# in your header
def load_javascripts(*scripts)
load_content(:javascripts,*scripts) do |script|
javascript_include_tag script
end
require 'nokogiri'
module Nokogiri
module XML
class Node
BLANK = /^[ \n]*$/
# Comparing with other node
# - same name
# - same attributes
@elisehuard
elisehuard / gist:630980
Created October 17, 2010 16:20
concurrent sieve of erathostenes - analogy with go example
-module(sieve).
-export([run/1]).
run(M) ->
Numbers = lists:seq(3, M),
Startpid = self(),
spawn_link(fun() -> prime_filter(Startpid, 2, Numbers) end),
gather().
gather() ->