This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
xsel | xmessage -buttons ok:2,not:0 -file - -timeout 4 | |
if [ $? -eq 2 ]; then | |
xsel | pk notes -s | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE PackageImports #-} | |
{- | |
You need to register your Twitter application at <http://dev.twitter.com/> | |
to get the consumer key and secret needed for OAuth. When connecting to | |
Twitter for the first time, do this: | |
let consumer = Consumer "consumer key" "consumer secret" | |
token <- authenticate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: snap-helloworld | |
Version: 0.1 | |
Category: Web | |
Build-type: Simple | |
Cabal-version: >=1.6 | |
Executable snap-helloworld | |
HS-Source-dirs: src | |
Main-is: Main.hs | |
Other-modules: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE QuasiQuotes #-} | |
import Quasi | |
f [$qq|test|] = True | |
f _ = False | |
main = do | |
print [$qq|test|] | |
print $ f [$qq|test|] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A min-heap. | |
type | |
TNode[T] = tuple[priority: int, data: T] | |
TBinHeap[T] = object | |
heap: seq[TNode[T]] | |
last: int | |
PBinHeap[T] = ref TBinHeap[T] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sass (sass) where | |
import Control.Monad.IO.Class (liftIO) | |
import Text.Hakyll.File (makeDirectories, toDestination) | |
import Text.Hakyll.HakyllAction (HakyllAction(..), runHakyllActionIfNeeded) | |
import Text.Hakyll.HakyllMonad (Hakyll) | |
import System.FilePath (replaceExtension) | |
import System.Process (readProcess) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# A small script to create a square thumbnail out of a picture of a human face. | |
# Written by Miikka Koskinen (http://miikka.me/) on 2012-04-07. | |
# Based on: | |
# http://recursive-design.com/blog/2010/12/14/face-detection-with-osx-and-python/ | |
import cv | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
int my_popen(char *cmd, FILE *handles[2]) { | |
/* Naming convention: the child's input and output */ | |
int input[2]; | |
int output[2]; | |
pipe(input); | |
pipe(output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eval_(foo) { | |
return eval(foo); | |
} | |
eval_("var quux = 1"); | |
eval_("console.log(quux)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <iostream> | |
int main(int argc, char**argv) | |
{ | |
std::time_t start = std::time(NULL); | |
while (std::time(NULL) - start < 10) { | |
std::cout << "piip!" << std::endl; | |
sleep(1); |
OlderNewer