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
PURPOSE | |
------- | |
The following is a walkthrough of Ruby on Rails installation on a VirtualBox'ed Ubuntu and some related tricks. | |
NOTES | |
----- | |
* Most of the commands below require superuser privileges, so with that in mind we proceed. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Anchor: selective underline CSS</title> | |
<style type="text/css"> | |
.a { | |
text-decoration:none; | |
font-size: 40px; | |
} | |
.w { |
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
<!-- CSS3 ROW STYLE CYCLING | |
* alternative pseudo-class notation: | |
:nth-child(2n) == :nth_child(even) | |
:nth-child(2n+1) == :nth_child(odd) | |
--> | |
<style type="text/css"> | |
table.css-cycle tr:nth-child(2n) { | |
background: silver; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Safari5 Dialog Z-Index Bug</title> | |
<style type="text/css"> | |
#overlay { | |
position: absolute; | |
left: 0; | |
top: 0; | |
width: 100%; |
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
class Timer | |
attr_reader :diff, :sum, :step | |
def initialize | |
reset! | |
end | |
def mark! | |
new_mark = now |
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
require 'goliath' | |
require 'base64' | |
class StreamingEchoedImageService < Goliath::API | |
def on_headers(env, headers) | |
env.logger.info "#{env['REQUEST_METHOD']} #{env['REQUEST_URI']}" | |
env.logger.info 'received headers: ' + headers.inspect | |
env['async-headers'] = headers | |
end |
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
# | |
# requires: | |
# a) run https://gist.github.com/2022231 on localhost:3001 | |
# b) provide a streamed.jpg at script location | |
# | |
# result: | |
# this fails for em-http-request v1.0.1 | |
# | |
require "rubygems" |
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 (window, checkNode){ | |
var p = {}; | |
var m = { | |
registerObserver: function() { | |
if (typeof(window.WebKitMutationObserver) == "undefined") return; | |
p.observer = new window.WebKitMutationObserver(function(mutationRecords) { | |
mutationRecords.forEach(function(mutationRecord) { | |
for (var i = 0; i < mutationRecord.addedNodes.length; ++i) |
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
require 'sinatra' | |
get '/' do | |
erb :index | |
end | |
get '/iframe' do | |
erb :iframe | |
end |
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
Gfx = (function(window) { | |
var document = window.document; | |
var canvas = document.createElement('canvas'); | |
var ctx = canvas.getContext('2d'); | |
var helpers = { | |
hyp: function(x0, y0, x1, y1) { | |
return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)); | |
}, | |
sign: function(value) { |
OlderNewer