This file contains hidden or 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 Main (main) where | |
import Control.Applicative ((<$>)) | |
import GHCJS.DOM (runWebGUI, webViewGetDomDocument) | |
import GHCJS.DOM.Document (documentGetBody, documentCreateElement) | |
import GHCJS.DOM.Types (castToHTMLDivElement) | |
import GHCJS.DOM.Node (nodeAppendChild) | |
import GHCJS.DOM.HTMLElement (htmlElementSetInnerText) | |
main :: IO () |
This file contains hidden or 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! Hoogle(function) | |
call system("chromium \"http://www.haskell.org/hoogle/?hoogle=" . a:function . "\"") | |
endfunction | |
" Search for the current word using Hoogle | |
nmap <Leader>H :call Hoogle("<C-R><C-W>")<CR> |
This file contains hidden or 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/zsh | |
time_status=$(date +%l:%M%p | sed "s/^ *//") | |
date_status=$(date +%A,\ %B\ %e) | |
battery_status=$(acpi | head -n1 | sed "s/^[^,]*, //" | sed "s/,.*//") | |
wifi_status=$(iwconfig wlp3s0 | grep ESSID | sed "s/^.*://" | tr -d '"') | |
notify-send -t 3000 "$time_status" "$date_status\nBattery: $battery_status\nConnected to $wifi_status" |
This file contains hidden or 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
% ruby capybara.rb | |
Testing #find | |
"Element 1" | |
Testing #all | |
[] | |
Testing #all with minimum | |
["Element 1", "Element 2", "Element 3", "Element 4", "Element 5"] |
This file contains hidden or 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
Do you like the taste of coffee? | |
| | | |
Yes No | |
| | | |
Do you like the taste of coffee without cream? Stop drinking coffee. | |
| | | |
No Yes ---------------------\ | |
| | | | |
| Do you like the taste of coffee without sugar? | | |
| | | | |
This file contains hidden or 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 env | |
RubyGems Environment: | |
- RUBYGEMS VERSION: 2.3.0 | |
- RUBY VERSION: 2.1.2 (2014-05-08 patchlevel 95) [x86_64-darwin13.0] | |
- INSTALLATION DIRECTORY: /Users/jferris/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0 | |
- RUBY EXECUTABLE: /Users/jferris/.rbenv/versions/2.1.2/bin/ruby | |
- EXECUTABLE DIRECTORY: /Users/jferris/.rbenv/versions/2.1.2/bin | |
- SPEC CACHE DIRECTORY: /Users/jferris/.gem/specs | |
- SYSTEM CONFIGURATION DIRECTORY: /Users/jferris/.rbenv/versions/2.1.2/etc | |
- RUBYGEMS PLATFORMS: |
This file contains hidden or 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
2.0.0-p353 |
This file contains hidden or 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/env ruby | |
# Save this somewhere on your path and make it executable | |
lines = STDIN.readlines | |
min_indent = lines.inject 100 do |result, line| | |
if line.strip.length == 0 | |
result | |
else |
This file contains hidden or 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
import Data.Time.Calendar (diffDays) | |
import Data.Time.LocalTime | |
( getZonedTime | |
, zonedTimeToLocalTime | |
, ZonedTime(..) | |
, LocalTime(..) | |
, TimeOfDay(..)) | |
import System.Process (readProcess) | |
data Comparison = Comparison { |
This file contains hidden or 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! Cd(path) | |
execute "cd " . a:path | |
edit . | |
endfunction | |
function! CompleteDirInCdPath(ArgLead, CmdLine, CursorPos) | |
let paths = split(globpath(&cdpath, '*'), '\n') | |
let result = [] | |
for path in paths | |
if isdirectory(path) |