Skip to content

Instantly share code, notes, and snippets.

Wypili moją krew na hejnał

Glutexo Glutexo

Wypili moją krew na hejnał
View GitHub Profile
Glutexo / decline.php
Last active Aug 29, 2015
Funkce pro hezké české vyskloňování podstatného jména.
View decline.php
// Vyskloňuje slovo hezky česky buď podle staršího,
// méně benevoletního a méně prasáckého paradigmatu:
// 1 položka, 2 položky, 5 položek, 10 položek,
// 15 položek, 20 položek, 21 položka, 22 položky
// 25 položek, 100 položek, 101 položka…
// nebo podle nového, čuňáckého:
// 1 položka, 2 položky, 5 položek, 10 položek,
// 15 položek, 20 položek, 21 položek, 22 položek
// 25 položek, 100 položek, 101 položek…
Glutexo / geocache-solver.rb
Last active Aug 29, 2015
Trivia-based mystery-cache solver. Output in KML format.
View geocache-solver.rb
Easy quiz/trivia mystery-cache solver. Takes possible
answers to questions and instructions how to transform
the indices into coordinates. Brute-force is used to
check all possible combinations that produce meaningful
coordinates. Returns a set of waypoins in KML format.
The values here are real for a specific Geocache.
Glutexo / php-bug-66173-example
Last active Aug 29, 2015
PHP bug #66173 example
View php-bug-66173-example
# Demo script of a bug #66137 (
# Converting an object with properties that have numeric names results
# in having an array with inaccessible keys.
$ary = [];
$ary["0"] = 'string';
Glutexo / post-receive
Last active Aug 29, 2015
Simple script to use git instead of SCP for app deployment.
View post-receive
# Checkouts the repository into the webserver application folder.
# Inspired by by Matthew Setter.
# The script assumes that the bare repository directory name (somename.git) is same as the deployment
# directory name, just without the .git extension (somename). The destination path (htdocs) needs to be
# changed according to your environment (line 14, DEPLOYPATH variable).
CURRENTDIR=`pwd | grep -o [^/]\\\\+$`
Glutexo /
Last active Aug 29, 2015
GIT: Creates a cumulative patch from the specified commit to the current HEAD.
# Won’t work if a branch called _squash_patch_tmp already exists.
# And probably many other caveats?
REFS_NAMED_HEAD=`git show-ref --heads --tags | grep "^[0-9a-f]\{40\} refs/\(heads\|tags\)/HEAD$"`;
if [ "$REFS_NAMED_HEAD" ]; then
echo "HEAD is ambiguous.";
exit 2
Glutexo /
Last active Aug 29, 2015
GIT: Incorporate changes made in an already merged branch to its merge commit.
# Takes changes done in a branch that was already merged into another and
# incorporates them into the already existing merge commit. Leaves in a
# detached HEAD state, the current HEAD being the patched original commit.
# If the patch cannot be applied cleanly, it is saved into ./patch.
if [ -z $1 -o -z $2 ]
Glutexo / remove-from-branch-name-end
Last active Aug 29, 2015
GIT: Remove # from the end of the name of all branches that end with it.
View remove-from-branch-name-end
if [ $1 = "-f" ]
Glutexo /
Created Feb 17, 2015
Log mail an raise an OS X notification
# Mail logging combined with OS X notification.
# Uses terminal-notifier –
# Writes the whole message with header to the file, timestamp included,
# and raises a system notification with the message subject. The log
# file (LOG_FILE variable) is opened in the Console app upon clicking
# on the notification.
Glutexo / random-file.rb
Created Feb 22, 2015
Creates a file filled with random content.
View random-file.rb
#!/usr/bin/env ruby
require 'securerandom'
TARGET_FILE_NAME = "random-file.iso"
TARGET_FILE_SIZE = 4707319808 # DVD-RW
CHUNK_SIZE = 1000000 # 1 MB
file = TARGET_FILE_NAME, 'w'
Glutexo / rot13-automator.applescript
Created Dec 6, 2011
ROT13 jako textová služba pro Automator
View rot13-automator.applescript
on run {input, parameters}
(* A když se jako další akce přidá provedení tohoto AppleScriptu
vyskočí nám zROT13ovaný vstup jako upozornění. *)
display dialog input as text buttons {"OK"}
return input
end run