Skip to content

Instantly share code, notes, and snippets.

body {background: #ccc;}
* {box-sizing:border-box;}
#container {width:300px;background:#eee;margin:0 auto}
.item {height:150px; width: 100px; background: white;
border:1px solid #ddd;line-height:50px;text-align:center;font-family:sans-serif;color:#ccc; font-size:20px;color:black;}
.item:after {color:gray;font-size:10px;}
.item.one-by-one:after {content:"1x1"}
.item.one-by-two {width:200px;}
.item.one-by-two:after {content:"1x2"}
.item.two-by-two {width:200px;height:300px;line-height:200px;}
@raphaelsaunier
raphaelsaunier / jquery.ngNav.js
Created May 17, 2013 13:12
Keyboard navigation for NextGEN Gallery
(function($){
$(document).on('keydown', function(e){
var code = e.keyCode || e.which;
if($.inArray(code, [37,39]) != -1)
document.location = $('.ngg-imagebrowser .'+(code==37?'back':'next')+' a').attr('href')+"#content";
});
})(jQuery);
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
!!! 5
/[if lt IE 7] <html class="no-js ie6 oldie" lang="en">
/[if IE 7] <html class="no-js ie7 oldie" lang="en">
/[if IE 8] <html class="no-js ie8 oldie" lang="en">
<!--[if gt IE 8]><!-->
%html.no-js{ :lang => "en" }
<!--<![endif]-->
%head
= render :partial => "/layouts/additional_meta"
<<<<<<< HEAD
# Black-Scholes Option Value
# Call value is returned in values[1], put in values[2]
blackscholes <- function(S, X, rf, T, sigma) {
values <- c(2)
d1 <- (log(S/X)+(rf+sigma^2/2)*T)/sigma*sqrt(T)
d2 <- d1 - sigma * sqrt(T)
values[1] <- S*pnorm(d1) - X*exp(-rf*T)*pnorm(d2)
values[2] <- X*exp(-rf*T) * pnorm(-d2) - S*pnorm(-d1)
values
}
for(i in 1:7) mean(rnorm(N))
R version 2.14.2 (2012-02-29)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-apple-darwin9.8.0/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
<?php
$key = 'our passphrase here';
$hash = 'f8956ba8af19b58e6a92e234abfebf13';
// Encryption function we'll use on our side. This would be retrieved as $_POST['signature'] on your side.
$signature = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $hash, MCRYPT_MODE_CBC, md5(md5($key))));
$decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($signature), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
if($hash == $decrypted)
@raphaelsaunier
raphaelsaunier / table.html
Created January 6, 2012 11:11
Table example
<table border="0" cellspacing="5" cellpadding="5" style="border:0;border-collapse:collapse;">
<tr><th colspan="2">Live Barclays Premier League</th></tr>
<tr><td>Bolton v Liverpool</td><td>Saturday, 21st January, 4:30pm</td></tr>
<tr><th colspan="2">Clydesdale Bank Premier League</th></tr>
<tr><td>Dunfermline v Celtic</td><td>Monday, 2nd January, 2:30pm</td></tr>
<tr><td>Bolton v Liverpool</td><td>Saturday, 21st January, 4:30pm</td></tr>
<tr><td>Bolton v Liverpool</td><td>Saturday, 21st January, 4:30pm</td></tr>
<tr><td>Bolton v Liverpool</td><td>Saturday, 21st January, 4:30pm</td></tr>
@raphaelsaunier
raphaelsaunier / gist:1475972
Created December 14, 2011 10:07
TemperatureConverterGUI.java
// TemperatureConverterGUI.java
// Author: Laurencia Walker-Fooks
// Program last changed: 7 December 2011
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.event.ActionListener;
public class TemperatureConverterGUI extends JFrame