- Paste history: ⌘ + Shift + h
- Instant Replay: ⌘ + Opt + b
- Mouseless selection: ⌘ + f; Tab
- Smart select: Quad-Click
- Rectangle Select: ⌘ + Opt + Select
- Open link (URL/File): ⌘ + Click
This file contains hidden or 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/bash | |
# works only with linux, depends on ffmpeg and android-tools installed. | |
# both `which ffmpeg` and `which adb` should return 0 | |
set -e -x | |
if [[ $# != 1 ]]; then | |
echo "Usage: $0 filename.png" | |
exit 0 | |
fi |
This file contains hidden or 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 Expression where | |
import Text.ParserCombinators.Parsec | |
import Text.Parsec.Token | |
import Control.Monad.Error | |
data Expr = LispInt Integer | | |
LispSym String | | |
LispLi [Expr] |
This file contains hidden or 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
import XMonad | |
import XMonad.Config.Gnome | |
import XMonad.Util.Run | |
import XMonad.Util.EZConfig | |
-- rewrite the start progs | |
startProgs prgs = mapM_ (\(cmd,args) -> safeSpawn cmd args) prgs | |
initProgs = [ ("setxkbmap", ["-option", "ctrl:nocaps"]) | |
, ("emacs", ["--daemon"]) |
This file contains hidden or 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
import Data.List | |
longest :: [Int] -> Int | |
longest ns = maybe 0 id $ elemIndex m zeroCount | |
where | |
zeroCount = tail $ scanl (\x y -> if (y == 0) then x+1 else 0) 1 ns | |
m = maximum zeroCount | |
cycleAtPoint :: [Int] -> [Int] | |
cycleAtPoint ns = take (length ns) $ drop (1 + longest ns) $ cycle ns |
This file contains hidden or 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
import Control.Monad | |
series :: [Int] | |
series = [2..] | |
filterMulti :: Int -> [Int] -> [Int] | |
filterMulti n = filter (\x -> x `mod` n /= 0) | |
sieve :: [Int] -> [Int] | |
sieve s = p:sieve ps |
This file contains hidden or 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/local/bin/python | |
# -*- coding: utf-8 -*- | |
# this uses bangalore open weather api to query the temparature near you. | |
# the api is documented here: http://www.yuktix.com/m/aws/media/yuktix-public-api.pdf | |
# This is a standalone script, eventhough I run this as a https://github.com/matryer/bitbar plugin. | |
API_ENDPOINT = "http://api1.yuktix.com:8080/sensordb/v1" | |
API_KEY = "" | |
SERIAL_NUMBER = "" # serial number of the weather station you are interested in. | |
CACHE_FILE="/tmp/weather_cache" # store recent data and display it while offline. |
This file contains hidden or 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
# infix calculation | |
# infix -> postfix -> eval | |
NUMS = map(lambda x: str(x), range(10)) | |
def toponlist(l): | |
return l[len(l)-1] | |
def dop(op, arg1, arg2): | |
if op == '-': |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"sync" | |
) | |
var ( | |
KeyMap = map[string]string{} |
This file contains hidden or 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 "add.h" | |
int add_two_numbers(int x, int y) { | |
return x + y; | |
} | |
int add_fzed_two_numbers(int x, int y) { | |
return add_two_numbers(FuzzNumber(x), | |
FuzzNumber(y)); | |
} |