This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
---------- Forwarded message ---------- | |
From: Mark S. Miller <[email protected]> | |
Date: Tue, Nov 16, 2010 at 3:44 PM | |
Subject: "Future of Javascript" doc from our internal "JavaScript Summit" | |
last week | |
To: [email protected] | |
On November 10th and 11th, a number of Google teams representing a variety | |
of viewpoints on client-side languages met to agree on a common vision for | |
the future of Javascript. |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |
# blog post: | |
module ActiveAdmin | |
module ViewHelpers | |
# lib/active_admin/view_helpers/auto_link_helper.rb | |
def auto_link(resource, link_content = nil) | |
content = link_content || display_name(resource) | |
if can?(:read, resource) && registration = active_admin_resource_for(resource.class) | |
begin |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>title</title> | |
</head> | |
<body> | |
<p>body</p> | |
</body> | |
</html> |
gem 'pg' | |
group :development do | |
gem 'ruby-debug' | |
end | |
gem 'rake', '~> 0.8.7' | |
gem 'devise' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
gem 'omniauth' | |
gem 'haml' | |
gem 'dynamic_form' |
/** | |
* Fixed width, fluid background | |
*/ | |
body { margin: 0; font-family: Futura, sans-serif; } | |
h1 { margin-top: 0 } | |
section { | |
width: 700px; |
# config/initializers/omniauth.rb | |
module OmniAuth | |
module Strategies | |
# tell OmniAuth to load our strategy | |
autoload :Pixelation, 'lib/pixelation_strategy' | |
end | |
end | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :twitter, "app_name", "secret" |
<div id="user_nav"> | |
<% if user_signed_in? %> | |
<img src="<%= user_avatar %>" id="main_avatar"> Signed in as <%= current_user.email %>.<br /> | |
Not you? | |
<% if session[:fb_token].nil? %> | |
<%= link_to "Sign out", destroy_user_session_path %> | |
<% else %> | |
<%= link_to "Sign out", facebook_logout_path %> | |
<% end %> |
$ vi ~/.ssh/config | |
# Add the following information | |
Host rails_blog_db | |
HostName 0.0.0.0 # your remote's public facing IP | |
Port 3122 | |
User jjackson # your username | |
LocalForward 3307 192.168.100.1:3306 |