This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
do -> | |
String.prototype.to_proc = (args...)-> | |
method = @ | |
(obj)->obj[method].apply(obj, args...) | |
console.log "a b c".split(/\s/).map (i)->i["toUpperCase"]() | |
# => [ "A", "B", "C" ] | |
console.log "a b c".split(/\s/).map "toUpperCase".to_proc() | |
# => [ "A", "B", "C" ] |
" vim: ft=vim | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" detect / switch encoding | |
Bundle 'mbbill/fencview' |
#!/usr/bin/env bash | |
if which mit-scheme &>/dev/null ; then | |
if [ $# -gt 0 ]; then | |
mit-scheme --quiet < $1 | |
else | |
echo "usage: $0 [scheme src]" | |
fi | |
else | |
echo "'mit-scheme' executable not found" | |
fi |
(define (inc i) (+ i 1)) | |
(define (product1 term a next b) | |
(if (> a b) | |
1 | |
(* (term a) | |
(product1 term (next a) next b)))) | |
(define (product2 term a next b) | |
(define (iter a result) |
% dpkg -l | egrep -i "psych|gstream|libgcc|libgl1|libglu1" | |
ii gir1.2-gst-plugins-base-1.0 1.2.4-1~ubuntu1 amd64 Description: GObject introspection data for the GStreamer Plugins Base library | |
ii gir1.2-gstreamer-1.0 1.2.4-0ubuntu1 amd64 Description: GObject introspection data for the GStreamer library | |
ii gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugin for ALSA | |
ii gstreamer0.10-fluendo-mp3:amd64 0.10.23.debian-3 amd64 Fluendo mp3 decoder GStreamer 0.10 plugin | |
ii gstreamer0.10-nice:amd64 0.1.4-1 amd64 ICE library (GStreamer 0.10 plugin) | |
ii gstreamer0.10-plugins-bad:amd64 0.10.23-7.2ubuntu1 amd64 GStreamer plugins from the "bad" set | |
ii gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2 |
import java.util.*; | |
import java.io.*; | |
import java.security.*; | |
public class ChangePassword | |
{ | |
private final static JKS j = new JKS(); | |
public static void main(String[] args) throws Exception | |
{ |
#!/usr/bin/ruby | |
puts "input N" | |
i=gets.to_i | |
m=[1] | |
1.upto i do |j| | |
puts "input N#{j}" | |
k=gets.to_i | |
m.unshift m[0]*(k+1) |
#!/usr/bin/ruby | |
class PE14 | |
@@l=Hash.new | |
@@l[1]=1 | |
def PE14.eval x | |
if @@l[x] #found | |
return @@l[x] | |
else | |
if x%2==0 #even | |
y=PE14.eval(x/2) |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/* | |
12306 Auto Query => A javascript snippet to help you book tickets online. | |
Copyright (C) 2011 Jingqin Lynn | |
Includes jQuery | |
Copyright 2011, John Resig | |
Dual licensed under the MIT or GPL Version 2 licenses. | |
http://jquery.org/license | |
Includes Sizzle.js |