I wrote this up here: http://blog.steveklabnik.com/posts/2012-02-27-hypermedia-api-reading-list
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
--type-add=js=.ejs | |
--type-add=ruby=.erb | |
--type-add=css=.sass | |
--type-add=ruby=.feature |
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
#! /usr/bin/ruby | |
home_dir = ENV["HOME"] | |
ssh_dir = "#{home_dir.strip}/.ssh/*.pub" | |
puts "Checking #{ssh_dir} ..." | |
puts | |
Dir["#{home_dir.strip}/.ssh/*.pub"].each do |pk| | |
puts "Fingerprint for #{pk}" | |
fingerprint = `ssh-keygen -lf #{pk}` |
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
# Switching projects like mad? | |
# t: start or restore a tmux session named after your current working directory | |
# | |
# e.g. calling t in /home/project/awesome_project will reattach the tmux session named | |
# awesome_project or create a new one | |
t() { tmux attach-session -t $(pwd | awk -F/ '{print $NF}') || tmux new-session -s $(pwd | awk -F/ '{print $NF}') ; } |
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
" Search Dash for word under cursor | |
function! SearchDash() | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") | |
let s:url = "dash://".s:wordUnderCursor | |
let s:cmd ="silent ! " . s:browser . " " . s:url | |
execute s:cmd | |
redraw! | |
endfunction | |
map <leader>d :call SearchDash()<CR> |
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
# http://www.mono-project.com/Compiling_Mono_on_OSX | |
require 'formula' | |
class Mono < Formula | |
#url 'http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2' | |
#sha1 'e2187f80366fcd65c55a1ab946f8d3b39e81be77' | |
url 'http://download.mono-project.com/sources/mono/mono-2.10.9.tar.bz2' | |
sha1 '1a6e8c5a0c3d88d87982259aa04402e028a283de' | |
Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.
Say you have a method that fetches data from a network resource:
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
function filterOutliers(someArray) { | |
if(someArray.length < 4) | |
return someArray; | |
let values, q1, q3, iqr, maxValue, minValue; | |
values = someArray.slice().sort( (a, b) => a - b);//copy array fast and sort | |
if((values.length / 4) % 1 === 0){//find quartiles |
OlderNewer