Skip to content

Instantly share code, notes, and snippets.

View beny's full-sized avatar
:octocat:
🆙 and 🏃‍♂️

Ondra Beneš beny

:octocat:
🆙 and 🏃‍♂️
View GitHub Profile
@beny
beny / gist:755442
Created December 26, 2010 14:21
vim config
syntax on
set number
set smarttab
set paste
filetype plugin on
set shiftwidth=4
colorscheme desert
set fileencodings=utf-8,cp1250,iso8859-2
@beny
beny / bash_profile
Last active September 24, 2015 21:48
Bash config
# enviroment variables
export EDITOR='mate -w'
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
export CLICOLOR=1
# Python
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Custom bash prompt via kirsle.net/wizards/ps1.html
@beny
beny / gist:929169
Created April 19, 2011 18:27
testovaci skript pro projekt do PRL cislo 3
#!/usr/bin/ruby
require "benchmark"
DEBUG = false
# kontrola zda je mocnina dvojky
def is_pow?(x)
true if (x != 0) && ((x & (x - 1)) == 0);
end
@beny
beny / convertEncoding.sh
Created October 30, 2011 16:51
convert LaTeX thesis template to unicode
#!/bin/bash
FROM=iso-8859-2
TO=UTF-8
FILES=("desky.tex" "fitthesis.cls" "literatura.bib" "obsah.tex" "prilohy.tex" "projekt.tex")
for i in "${FILES[@]}"
do
iconv -f $FROM -t $TO $i > tmp
sed 's/latin2/utf8/g' tmp > tmp2
@beny
beny / decrypt.rb
Created December 30, 2011 09:41
h4[K3r5 mini help
#!/usr/bin/ruby
#
# simple Brute-Force recursive algorithm for decrypting crypt function
# try whatever you want in crypt function
#
# enjoy
require 'zlib'
def decrypt(x)
@beny
beny / mail_notes.rb
Created July 20, 2012 15:16
simple script, which finds Notes from iOS app in my Gmail
require "net/imap"
require "mail"
=begin
SAMPLE zpravy
Subject: =?utf-8?Q?Kv=C4=9Btin=C3=A1=C5=99stv=C3=AD_D=C4=9Bl=C5=88=C3=A1k?=
From: =?utf-8?Q?Ondra_Bene=C5=A1?= <steve.jobs@gmail.com>
X-Universally-Unique-Identifier: DDC4E35E-7D70-4E97-8167-011B204229D3
@beny
beny / gist:3187985
Created July 27, 2012 13:22
git commands which cleans repo history index from too big files
git filter-branch --index-filter 'git rm --cached --ignore-unmatch -- *.mbtiles' --prune-empty -- --all
rm -fr .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
@beny
beny / gist:3834854
Created October 4, 2012 16:44
Xcode build number auto increment
conf=${CONFIGURATION}
if [ $conf != "Debug" ]
then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist)
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist
fi
@beny
beny / gist:4329499
Last active December 9, 2015 21:18
Git config
[core]
excludesfile = ~/.gitignore
quotepath = false
[diff]
external = ~/.opendiff-git.sh
[merge]
tool = opendiff
[user]
name = Ondrej Benes
email = <my-email>
@beny
beny / gist:5729615
Created June 7, 2013 14:22
Color selected cell background with color defined inside as hex code (#aabbff)
Sub Color()
For Each rCell In Selection
rCell.Interior.Color = RGB(CInt("&H" & Mid(rCell.Value, 2, 2)), CInt("&H" & Mid(rCell.Value, 4, 2)), CInt("&H" & Mid(rCell.Value, 6, 2)))
Next rCell
End Sub