This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
/* | |
* sanitize HTML with jQuery based on whitelist | |
* example: | |
* sanitizer.sanitize('<a href="foo" class="bar">aaa</a><script>alert("...")</script>', {'a': ['href'], 'strong': []}) | |
* returns '<a href="foo">aaa</a>' | |
*/ | |
var sanitizer = {}; | |
(function($) { | |
function trimAttributes(node, allowedAttrs) { |
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 |
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# | |
# Sample subdomain test: | |
# it "should test subdomain" do | |
# switch_to_subdomain("mysubdomain") | |
# visit root_path | |
# end | |
DEFAULT_HOST = "lvh.me" |
#!/usr/bin/env ruby | |
# | |
# newrailsproject.rb | |
# | |
# Description: | |
# Easily create a new Rails project and Sublime Text 2 project file. | |
# | |
# By Jonathan Beebe. MIT License. | |
# | |
# Syntax: ruby newrailsproject.rb PROJECT_NAME BASE_PATH [sublime_project_basepath] |
Upgrading to homebrew postgresql 9.1.1 from 9.0.x | |
* Copy the old data | |
mv -R /usr/local/var/postgres/ /usr/local/var/postgres-901 | |
* Create a new database using 9.1.1 | |
/usr/local/Cellar/postgresql/9.1.1/bin/initdb /usr/local/var/postgres |
-- Find the note in omnifocus for the current project / folder | |
-- (or create a new one) and display it. | |
-- Created by Mark Fowler ([email protected]) | |
-- Help from http://veritrope.com/code/search-evernote-for-notes-containing-link-to-selected-omnifocus-item/ | |
-- on getting the name / url for the current omnifocus item | |
tell front window of application "OmniFocus" | |
try |
=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') |