Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
sirkkalap / gist:4494394
Created January 9, 2013 16:14
# Lataa ja tallenna metadata-osa testcases urleista
#!/bin/bash
# Lataa ja tallenna metadata-osa testcases urleista
testcases=("01-lhtiedot-kunta_kunta=1_olotila=1|http://ceto.solita.fi:7080/kios-tp/tp/eraajo/lainhuutotiedot/kunta/xml?kunta=1&olotila=1"
"02-lhtiedot-kunta_kunta=5_olotila=1|http://ceto.solita.fi:7080/kios-tp/tp/eraajo/lainhuutotiedot/kunta/xml?kunta=5&olotila=1")
BASEDIR=$(cd "$(dirname "$0")"; pwd)
SUBPROJECT_HOME=$(cd "$BASEDIR/.."; pwd)
set -eu
@sirkkalap
sirkkalap / gist:4502652
Created January 10, 2013 14:58
01-irrotus-lhtiedot-kunta_kunta=21_olotila=1-md.xml
<y:metatiedot xmlns:y="http://xml.nls.fi/ktjkir/yhteinen/2012/01/01"><y:tiedostonLuontiaika>2013-01-10T14:43:10.990+02:00</y:tiedostonLuontiaika><y:tiedostonLuonninAloitusaika>2013-01-10T14:36:04.233+02:00</y:tiedostonLuonninAloitusaika><y:tiedostonLuonninKestoMillisekunteina>426757</y:tiedostonLuonninKestoMillisekunteina><y:kohteidenLukumaara>611</y:kohteidenLukumaara><y:kyselyparametrit><y:Kyselyparametri nimi="metatiedotMukana">true</y:Kyselyparametri><y:Kyselyparametri nimi="perustiedotMukana">true</y:Kyselyparametri><y:Kyselyparametri nimi="osoitetiedotMukana">true</y:Kyselyparametri><y:Kyselyparametri nimi="kunta">21</y:Kyselyparametri><y:Kyselyparametri nimi="luovuttajanTunnuksetMukana">false</y:Kyselyparametri><y:Kyselyparametri nimi="annetutKunnat">true</y:Kyselyparametri><y:Kyselyparametri nimi="olotila">1</y:Kyselyparametri><y:Kyselyparametri nimi="kohdelaji">KI</y:Kyselyparametri><y:Kyselyparametri nimi="kohdelaji">MA</y:Kyselyparametri><y:Kyselyparametri nimi="henkilotunnuksetMukana">true</y:Kyse
@sirkkalap
sirkkalap / gist:5187533
Last active December 15, 2015 02:29
svndiff, that behaves somewhat like git diff does.
function svndiff {
svn diff "$@" | colordiff | less -rFX
}
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
@sirkkalap
sirkkalap / Run Synergy in Screen for Mavericks
Created December 12, 2013 15:57
Run Synergy in Screen. This works around the issues between OS X 10.9 Mavericks and Synergy 1.4.15 I found this from the internet: http://synergy-foss.org/spit/issues/details/3642/ . In case you have not used Applescript before, launch application called Automator and read in, or google for it.
on run {input, parameters}
(* Run Synergy in screen *)
tell application "Terminal"
set currentTab to do script ("screen -R;")
delay 2
do script ("/Applications/Synergy.app/Contents/MacOS/Synergy") in currentTab
end tell
return input
# http://stackoverflow.com/a/7819465/720077
takeover() {
# create a temporary session that displays the "how to go back" message
tmp='takeover temp session'
if ! tmux has-session -t "$tmp"; then
tmux new-session -d -s "$tmp"
tmux set-option -t "$tmp" set-remain-on-exit on
tmux new-window -kt "$tmp":0 \
'echo "Use Prefix + L (i.e. ^B L) to return to session."'
vows = require 'vows'
zombie = require 'zombie'
assert = require 'assert'
events = require 'events'
promise = require 'promise'
zombie.synchronousChain = (browser, steps)->
promise = new(events.EventEmitter)
zombie._linkInTheChain(promise, browser, steps)
promise
@sirkkalap
sirkkalap / What to do when your homebrew reinstall exceeds github rate limit?
Created June 3, 2014 18:51
What to do when your homebrew reinstall exceeds github rate limit?
petrisi@karnak  ~  brew search subversion
subversion
Error: GitHub API rate limit exceeded
Solution:
Visit github.com -> settings -> applications and add a authentication token for homebrew
Visit the given key to check it is ok
@sirkkalap
sirkkalap / retinashot.sh
Created June 10, 2014 08:56
Screenshot in scale 50% (for Retina)
# the path where screenshots to save
SS_PATH="/Users/petrisi/Desktop"
# if you want to save them to your desktop, SS_PATH should be "/Users/YOURNAME/Desktop"
# a variable of unix timestamp for screenshot file name
DATE=$(date +%Y-%m-%d)
TIME=$(date +%H.%M.%S)
NOW=""
SS_BASENAME="$SS_PATH/Näyttökuva $DATE kello $TIME"
@sirkkalap
sirkkalap / uninstall_fsecure.sh
Created June 10, 2014 09:35
Uninstall F-Secure from OSX
#!/bin/sh
PARTIAL=false
NUKE_CUSTOMIZATIONS=true
while getopts uc opt
do
case "$opt" in
u) PARTIAL=true
;;