Skip to content

Instantly share code, notes, and snippets.

View alex-quiterio's full-sized avatar
🌀
using my coding skills to fight for the climate

aIex quiterio alex-quiterio

🌀
using my coding skills to fight for the climate
View GitHub Profile
@alex-quiterio
alex-quiterio / script.js
Created November 25, 2012 18:35
A CodePen by Chris Coyier.
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 30000,
width: 400,
height: 600,
theme: {
shell: {
background: 'transparent',
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@alex-quiterio
alex-quiterio / dabblet.css
Created March 1, 2013 12:05
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 12%;
border-ra
public class Test {
@Assertion("foo>0")
int foo=1;
@Assertion("bar%2==0")
long bar;
@Assertion("baz>foo")
int baz;
class ApplicationController < ActionController::Base
caches_action :render_html,
:cache_path => Proc.new { "#{LastChange::last_update}/pages/#{params[:cms_path]}" },
:if => Proc.new { controller_name == "cms_content" }
end
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc

Latency numbers every programmer should know

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  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--
According with the number used on the property
ServersNumber the bootstrapper will fetch this XML
and look for servers to initialize
-->
<add key="ServersNumber" value="1" />
var self = window;
(function(self) {
var canvas, context, particles = [], explode = true, FPS = 60;
/*
* Init.
*/