Skip to content

Instantly share code, notes, and snippets.

View finnp's full-sized avatar
🦆

Finn Pauls finnp

🦆
View GitHub Profile
@finnp
finnp / synchronize_clapper_audios.praat
Created June 14, 2012 21:54
Praat script for Synchronizing audios
video = selected ("Sound", 1)
audio = selected ("Sound", 2)
select video
maxvideo = Get time of maximum... 0 0 none
select audio
maxaudio = Get time of maximum... 0 0 none
audioend = Get end time
sf = Get sampling frequency
printline
printline Video-Clap: 'maxvideo' Sekunden
@finnp
finnp / akers_stab_alletitelspiele.txt
Last active October 6, 2015 16:58
Inoffizielle Fußballweltmeisterschaft der Frauen und Akers-Stab Unofficial Women's Football World Championships and Akers' batton (country names in German)
# Akers-Stab - Alle Titelspiele, Titelwechsel sind markiert
30.11.1991: 1:2 - Norwegen - USA (Erste Titelvergabe)
28.03.1992: 0:0 - Frankreich - Norwegen
17.04.1992: 1:0 - Frankreich - Sowjetunion
18.04.1992: 4:2 - Frankreich - USA
19.04.1992: 6:1 - Frankreich - Elfenbeinküste
02.05.1992: 0:4 - Frankreich - Dänemark (Titelwechsel)
02.05.1992: 0:4 - Frankreich - Dänemark
17.05.1992: 5:0 - Dänemark - Finnland
@finnp
finnp / rank.js
Created February 20, 2013 18:35
Little script in node.js which uses the facebook API to rank users within a group by number of recent posts. This has been done within HelsinkiJS #Peerprogramming
// Give the script a facebook token and a group id
var APIKEY = "";
var GROUP = "";
var https = require('https');
https.get({hostname:'graph.facebook.com', path:'/' + GROUP + '/feed?access_token=' + APIKEY, agent:false}, function (res) {
var chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk.toString());
@finnp
finnp / index.html
Created May 16, 2013 11:01
Simple Todo-App using AngularJS (http://angularjs.org/) and Parse (https://parse.com/). Done at the HelsinkiJS #PeerProgramming. http://helsinkijs.org/
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.2.7.min.js"></script>
<script src="todo.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div class="container" ng-controller="Todo">
@finnp
finnp / anvil_slicer.py
Created May 16, 2013 15:52
Python script that slices the elements from an exported Anvil file. This way each line of the data will have a slice of the annotation, instead of information about an anvil element. Anvil: http://www.anvil-software.org/
import csv
import math
# Specify the path to the exported Anvil csv file (*.txt)
filename_input = ''
# Specify the path where the output csv file should be saved
filename_output = ''
# CSV delimiter
delimiter_for_input = ' '
@finnp
finnp / 99haskellproblems.hs
Created August 22, 2013 20:48
99 Problems in Haskell
-- Problem 1
myLast :: [a] -> a
myLast xs = xs !! (length xs - 1)
-- Problem 2
myButLast :: [a] -> a
myButLast xs = (drop (length xs - 2) xs) !! 0
-- Problem 3
elementAt :: [a] -> Int -> a
@finnp
finnp / todo.hs
Last active December 22, 2015 00:38
Simple terminal task manager
module Main where
import System.Environment( getArgs )
import System.IO
import Control.Monad
import Data.List.Split
main = do
args <- getArgs
mapM execute_command (split_commands args)
@finnp
finnp / codeivate.py
Last active December 22, 2015 01:09
Python command line script for codeivate.com
import json
import urllib
import sys
import datetime
import time
def color_text(text, color = "green"):
colors = {
"green": '\033[92m',
@finnp
finnp / podio_image_upload.rb
Created September 8, 2013 16:44
Bulk uploading pictures to an app in Podio
require 'rubygems'
require 'podio'
app_id = '<ID of the App'
dir = "<Directory of images>"
titels = "<Image Title>" # Index gets added automatically
i = 1 # Starting index for the title
@finnp
finnp / rgb.ino
Created December 26, 2013 00:22
REST API for an RGB LED.
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
int red = 0;
int green = 0;
int blue = 0;
int ledR = 9;
int ledG = 10;
int ledB = 11;