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
<?xml version="1.0" encoding="ISO-8859-1" ?> | |
<grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-us" mode="dtmf" root="___ROOT___"> | |
<rule id="___ROOT___" scope="public"> | |
<one-of> | |
<item> | |
<item repeat="10"> | |
<ruleref uri="#DIGITS" /> | |
</item> | |
</item> |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
URL Page_Title Date Transcript Img_Title Img_URL Keywords from http://www.andromedayelton.com/dckx.php | |
http://xkcd.com/1 Barrel - Part 1 [[A boy sits in a barrel which is floating in an ocean.]] Boy: I wonder where I'll float next? [[The barrel drifts into the distance. Nothing else can be seen.]] {{Alt: Don't we all.}} Don't we all. http://imgs.xkcd.com/comics/barrel_cropped_(1).jpg | |
http://xkcd.com/2 Petit Trees (sketch) [[Two trees are growing on opposite sides of a sphere.]] {{Alt-title: 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch}} 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch http://imgs.xkcd.com/comics/tree_cropped_(1).jpg | |
http://xkcd.com/3 Island (sketch) [[A sketch of an Island]] {{Alt:Hello, island}} Hello, island http://imgs.xkcd.com/comics/island_color.jpg | |
http://xkcd.com/4 Landscape (sketch) [[A sketch of a landscape with sun on the horizon]] {{Alt: There's a river flowing through the ocea |
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
/* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon | |
* http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */ | |
s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17 | |
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;} |
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 reorder_children(ordered_ids) | |
ordered_ids = ordered_ids.map(&:to_i) | |
current_ids = children.map(&:id) | |
unless current_ids - ordered_ids == [] && ordered_ids - current_ids == [] | |
raise ArgumentError, "Not ordering the same ids that I have as children. My children: #{current_ids.join(", ")}. Your list: #{ordered_ids.join(", ")}. Difference: #{(current_ids - ordered_ids).join(', ')} / #{(ordered_ids - current_ids).join(', ')}" | |
end | |
j = 0 | |
transaction do | |
for new_id in ordered_ids | |
old_id = current_ids[j] |
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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.19370138645172119</real> | |
<key>Green Component</key> | |
<real>0.15575926005840302</real> |
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
set nocompatible | |
set noedcompatible | |
set hidden | |
" Pathogen bundle manager | |
runtime bundle/vim-pathogen/autoload/pathogen.vim | |
call pathogen#infect() | |
" Indention and Syntax |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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 colorize(value, color) | |
case color | |
when :black then "\e[30m" + value.to_s + "\e[0m" | |
when :red then "\e[31m" + value.to_s + "\e[0m" | |
when :green then "\e[32m" + value.to_s + "\e[0m" | |
when :yellow then "\e[33m" + value.to_s + "\e[0m" | |
when :blue then "\e[34m" + value.to_s + "\e[0m" | |
when :magenta then "\e[35m" + value.to_s + "\e[0m" | |
when :cyan then "\e[36m" + value.to_s + "\e[0m" | |
when :white then "\e[37m" + value.to_s + "\e[0m" |
OlderNewer