Skip to content

Instantly share code, notes, and snippets.

View bartlomiejdanek's full-sized avatar

Bartłomiej Danek bartlomiejdanek

View GitHub Profile
@bartlomiejdanek
bartlomiejdanek / console_cheatsheet
Created October 25, 2011 18:32
console cheatsheet
# convert all eps from current directory to png
$ ls | grep eps | awk '{print "convert "$1" "$1""}' | sed s/eps/png/2 | sh
@bartlomiejdanek
bartlomiejdanek / reinstall_drivers.bash
Created December 19, 2011 16:25
ubuntu - sound cart - reinstall drivers
#!/bin/bash
sudo su
apt-get --purge remove linux-sound-base alsa-base alsa-utils
apt-get install linux-sound-base alsa-base alsa-utils
apt-get install gdm ubuntu-desktop
reboot
@bartlomiejdanek
bartlomiejdanek / .irbrc
Created December 20, 2011 19:23
IRB configuration
# Make gems available
require 'rubygems' if RUBY_VERSION <= '1.9.0'
# http://drnicutilities.rubyforge.org/map_by_method/
require 'map_by_method'
# Dr Nic's gem inspired by
# http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html
require 'what_methods'
<?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>AnimateDimming</key>
<false/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
@bartlomiejdanek
bartlomiejdanek / git-remove-file.sh
Created January 10, 2012 10:23
remove file from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@bartlomiejdanek
bartlomiejdanek / 0-readme.md
Created January 30, 2012 10:49 — forked from burke/0-readme.md
ruby-1.9.3-p0 cumulative performance patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@bartlomiejdanek
bartlomiejdanek / god
Created February 1, 2012 14:54
/etc/init.d/god
#!/bin/sh
### BEGIN INIT INFO
# Provides: god
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: God
@bartlomiejdanek
bartlomiejdanek / .bashrc
Created February 13, 2012 17:28
.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]] ; then
#[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
@bartlomiejdanek
bartlomiejdanek / .tmux.conf
Created March 29, 2012 06:43
tmux configuration
setw -g xterm-keys on
set -g terminal-overrides "*88col*:colors=88,*256col*:colors=256,xterm*:colors=256"
set -g default-terminal "screen-256color"
set-option -g prefix C-a
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix
#set-option -g mouse-select-pane on
@bartlomiejdanek
bartlomiejdanek / algorytm_robienia_kawy.rb
Created September 25, 2012 14:12
Algorytm robienia kawy
# encoding: utf-8
module Selleo::Kuchnia
class PojemnikNaKapsułki
include Singleton
state_machine :initial => :pusty do
state :pusty
state :pełny