Skip to content

Instantly share code, notes, and snippets.

View pkazmierczak's full-sized avatar
🏋️‍♂️
at the gym.

Piotr Kazmierczak pkazmierczak

🏋️‍♂️
at the gym.
View GitHub Profile
@pkazmierczak
pkazmierczak / quick-player.scpt
Last active August 29, 2015 14:00
Last.fm cheater
tell application "iTunes"
set mySongs to every track of library playlist 1 whose artist is "Uri Caine Trio"
repeat with theTrack in mySongs
play theTrack
repeat until (player position > ((get duration of the current track) / 2)) or (player position > 240)
delay 0.5
end repeat
end repeat
end tell
@pkazmierczak
pkazmierczak / stagHunt.py
Created December 10, 2014 20:23
stagHunt
import numpy
import random
class Agent():
def __init__(self,
location={'x': 0, 'y': 0},
vision=1,
strategy='defect',
fitness=0,
EndofTheWorld=32):
@pkazmierczak
pkazmierczak / .vimrc
Created March 5, 2015 12:51
My vim configuration
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Vundles!
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
@pkazmierczak
pkazmierczak / gist:3204b7ef7703e231ff9e
Last active August 29, 2015 14:21
EC2 ami configuration for Typo3 7
sudo sed '/deb-src/d' /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python-setuptools apache2 mysql-client php5 php5-cli php5-gd php5-mysql memcached php5-curl php5-memcache php5-xcache ppthtml unrtf xlhtml
sudo apt-get clean
wget https://github.com/s3tools/s3cmd/archive/master.zip # we need newest s3cmd for Frankfurt V4 auth
unzip master.zip
cd s3cmd
sudo python setup.py install
@pkazmierczak
pkazmierczak / thesis.tex
Created August 19, 2015 14:02
changing paper size to conform to UiB's rules
\documentclass[ twoside,openright,titlepage,numbers=noenddot,
headinclude,%1headlines,% letterpaper a4paper
footinclude=true,cleardoublepage=empty,abstractoff,
%BCOR=5mm,
paper=a4,
fontsize=12pt,%11pt,a4paper,%
ngerman,american,%
]{scrreprt}
%********************************************************************
@pkazmierczak
pkazmierczak / simple-duplicity.sh
Created January 2, 2012 15:33
Simple script for automatic backup using duplicity
#!/bin/bash
BACKUP_SCRIPT=${0##*/}
DUPLICITY="/usr/bin/duplicity"
DATE="/bin/date +%R-%d-%m-%y"
BACKUP_COMMAND="$DUPLICITY --exclude=/media/backups --exclude=/home/piotr/.cache --exclude=/home/piotr/.thumbnails --exclude=/home/piotr/.gvfs --exclude=/home/piotr/.xsession-errors --exclude=/home/piotr/.recently-used.xbel --exclude=/home/piotr/.recent-applications.xbel --exclude=/home/piotr/.Private --exclude=/tmp --exclude=/proc --exclude=/sys --exclude=/home/piotr/.local/share/Trash --exclude=/home/piotr/muzzik --exclude=/home/piotr/filmy --exclude=/home/piotr/.beagle --exclude=/home/piotr/.opera --exclude=/home/piotr/.thumbnails --exclude=/home/piotr/.VirtualBox --exclude=/home/piotr/.cache --exclude=/home/piotr/downloads --include=/home/piotr --exclude=** --no-encryption / file:///media/backups --volsize=250 --archive-dir=/home/piotr/.cache/deja-dup"
# Sanity checks
if test -z "$BASH" ; then
@pkazmierczak
pkazmierczak / jekyll-create-tag-pages-rakefile.rb
Created January 3, 2012 09:05 — forked from kez/jekyll-create-tag-pages-rakefile.rb
This fork works for 'tags', not 'categories'.
desc 'Generate tags page'
task :tags do
puts "Generating tags..."
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
@pkazmierczak
pkazmierczak / another_atl_model.tex
Created November 25, 2012 17:15
Example ATL model
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{center}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,
state/.style={circle,draw,node distance=3cm},
big state/.style={ellipse,draw,node distance=3cm},
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>???</string>
<key>settings</key>
<dict>
@pkazmierczak
pkazmierczak / iam.json
Created January 12, 2016 12:31
AWS IAM policy for allowing access to all but the specified resources
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1452600517000",
"Effect": "Allow",
"Action": [
"s3:*"
],
"NotResource": [