Skip to content

Instantly share code, notes, and snippets.

@snoyberg
snoyberg / Add.hs
Last active Aug 29, 2015
Minimal multifile Yesod application
View Add.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Add where
import Foundation
import Yesod
getAddR :: Int -> Int -> Handler TypedContent
getAddR x y = selectRep $ do
provideRep $ defaultLayout $ do
@abhidilliwal
abhidilliwal / jsbin.OhuQuVaQ.css
Created Jan 16, 2014
just like scrollIntoView but with animation: http://jsbin.com/OhuQuVaQ/3/edit
View jsbin.OhuQuVaQ.css
#container{
border: 1px solid green;
height: 300px;
overflow: auto;
padding: 20px;
}
.block{
background-color: green;
height: 50px;
@klutzy
klutzy / hello.rs
Last active Apr 26, 2016
Rust with Emscripten
View hello.rs
// emscripten uses le32-unknown-nacl triple but rustc doesn't know it now.
// So just use similar target instead.
// `rustc hello.rs --target=i686-unknown-linux --emit-llvm -S --cfg libc`
// `emcc hello.ll -o hello.js`
// no `extern mod`.
#[no_std];
#[feature(macro_rules)];
use core::container::Container;
@haarts
haarts / torrc
Created Oct 15, 2012
Tor configuration file
View torrc
## Configuration file for a typical Tor user
## Last updated 16 July 2009 for Tor 0.2.2.1-alpha.
## (May or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/tor-manual.html,
## for more options you can use in this file.
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
You can’t perform that action at this time.