Skip to content

Instantly share code, notes, and snippets.

@snoyberg
snoyberg / Add.hs
Last active August 29, 2015 14:11
Minimal multifile Yesod application
{-# 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 January 16, 2014 16:55
just like scrollIntoView but with animation: http://jsbin.com/OhuQuVaQ/3/edit
#container{
border: 1px solid green;
height: 300px;
overflow: auto;
padding: 20px;
}
.block{
background-color: green;
height: 50px;
@klutzy
klutzy / hello.rs
Last active April 26, 2016 19:15
Rust with Emscripten
// 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;
@ceckoslab
ceckoslab / basic-rum-beacon-transfer-cloudflare-edge-worker.js
Last active December 14, 2021 21:18
A concept of Cloud Flare edge worker that is used for transferring beacons to beacon catcher server.
var beaconCatcherAddress = "https://rum.revampix.com/beacon/catcher.php"
addEventListener('fetch', event => {
event.respondWith(handle(event, event.request))
})
async function asyncFetch(request) {
let response = fetch(request)
.then(
function() {},
@haarts
haarts / torrc
Created October 15, 2012 09:50
Tor configuration file
## 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 April 20, 2012 13:29
URI Parsing with Javascript
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"