This file contains 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/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." |
This file contains 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
➜ ~ 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 |
This file contains 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
# 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?" |
This file contains 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
gem install hanna |
This file contains 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
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 |
This file contains 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
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); |
This file contains 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
# add in .zshrc or .bashrc | |
# or in rubymine's startup script :) | |
export AWT_TOOLKIT='MToolkit java -jar weka.jar' |
This file contains 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
# 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 |
This file contains 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 'nokogiri' | |
module Nokogiri | |
module XML | |
class Node | |
BLANK = /^[ \n]*$/ | |
# Comparing with other node | |
# - same name | |
# - same attributes |
This file contains 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
-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() -> |
OlderNewer