This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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… | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
=begin | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
# Demo script of a bug #66137 (https://bugs.php.net/bug.php?id=66173) | |
# Converting an object with properties that have numeric names results | |
# in having an array with inaccessible keys. | |
$ary = []; | |
$ary["0"] = 'string'; | |
var_dump($ary); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Checkouts the repository into the webserver application folder. | |
# Inspired by http://www.sitepoint.com/one-click-app-deployment-server-side-git-hooks/ 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). | |
read OLDREV NEWREV REFNAME | |
CURRENTDIR=`pwd | grep -o [^/]\\\\+$` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 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 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 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 ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $1 = "-f" ] | |
then | |
FORCE="$1" | |
TRAILING_PATTERN="$2" | |
else | |
FORCE="" | |
TRAILING_PATTERN="$1" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Mail logging combined with OS X notification. | |
# Uses terminal-notifier – https://github.com/alloy/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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'securerandom' | |
TARGET_FILE_NAME = "random-file.iso" | |
TARGET_FILE_SIZE = 4707319808 # DVD-RW | |
CHUNK_SIZE = 1000000 # 1 MB | |
file = File.new TARGET_FILE_NAME, 'w' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer