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 | |
# Intearctively select one of the recent branches and checkout it. | |
set -e | |
git rev-parse --is-inside-work-tree >/dev/null | |
git checkout $(git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | fzf -q "$*") |
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
var x = cos * sideHexOffset - sin * (vertHexOffest + sideVertHexOffset); | |
var y = cos * (sideVertHexOffset + vertHexOffest) + sin * sideHexOffset; | |
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
% cabal install hledger-web | |
Resolving dependencies... | |
Configuring hledger-web-0.22.1... | |
Building hledger-web-0.22.1... | |
Preprocessing library hledger-web-0.22.1... | |
Application.hs:31:7: | |
warning: missing terminating ' character [-Winvalid-pp-token] | |
-- Don't forget to add new modules to your cabal file! | |
^ |
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/bin/env python | |
import fnmatch | |
from ftplib import FTP | |
import os | |
import sys | |
class Downloader(object): | |
destdir = '.' | |
pattern = '*' |
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/sh | |
# Etsitään tiedostot hakemistosta foo ja siirretään ne hakemistoon bar | |
find foo -type f -exec mv {} bar \; | |
# Vaihtoehtoinen tapa, joka lienee nopeampi jos on paljon tiedostoja: | |
find foo -type f -print0 | xargs -0 -n 25 mv -t bar | |
# Tiedostot on siirrety pois foosta, poistetaan foo | |
rm -r foo |
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 <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); |
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
function eval_(foo) { | |
return eval(foo); | |
} | |
eval_("var quux = 1"); | |
eval_("console.log(quux)"); |
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 <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 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/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 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 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) |