This file contains hidden or 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
$.event.special.touchclick = { | |
setup : function(data) { | |
var elt = $(this); | |
elt.data($.extend({ | |
sens : 25 // Available touch offset in pixels | |
}, data)); | |
elt.bind("touchstart", $.event.special.touchclick.onTouchstart); | |
elt.bind("touchend", $.event.special.touchclick.onTouchend); |
This file contains hidden or 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
import os | |
import gtk | |
from textblob import TextBlob | |
word = gtk.clipboard_get(selection="PRIMARY").wait_for_text() | |
if not word: | |
word = gtk.clipboard_get(selection="CLIPBOARD").wait_for_text() | |
if word: | |
source_lang = TextBlob(word).detect_language() |
This file contains hidden or 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/bash | |
cmd=$1 | |
arguments=${@:2} | |
if [[ $cmd = "install" ]]; then | |
command sudo apt-get install $arguments | |
exit 0 | |
fi |
This file contains hidden or 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 bash | |
if [ $# -eq 0 ]; then | |
echo 'HTTPDump - wrapper for TCPDump' | |
echo 'Usage: httpdump [HOST|any]' | |
exit 0 | |
fi | |
host=$1 | |
host_cond="" |
This file contains hidden or 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 bash | |
# Check is in git repo | |
if ! [ -d .git ] || ! git rev-parse --git-dir > /dev/null 2>&1; then | |
echo "Git repository not found"; | |
exit 1; | |
fi | |
branch=${1}; | |
commits_limit=5 |
This file contains hidden or 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
<?php | |
/** | |
* Get access to array via dot notation, for example: | |
* 'user.names.first' | |
* @param array $array Source array | |
* @param string $path Path in dot notation | |
*/ | |
function getByDotNotation($array, $path) { | |
foreach (explode('.', $path) as $part) { |
This file contains hidden or 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
<?php | |
/** | |
* Получает параметры из строки по регулярному выражению, например: | |
* getParamsByRegex('/<controller:\w+>/<id>/<action>', '/user/5/login') вернет массив | |
* [ | |
* 'controller' => 'user', | |
* 'id' => 5, | |
* 'action' => 'login | |
* ] |
This file contains hidden or 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 php | |
<?php | |
$file = fopen('php://stdin', 'r'); | |
$lines = ''; | |
while ($line = fgets($file)) { | |
$lines .= $line; | |
} | |
$array = json_decode($lines, true); | |
echo json_encode($array, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL; |
This file contains hidden or 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 bash | |
if [ $# -le 2 ]; then | |
echo 'convert-tint - script for tinting images, replace any color with given.' | |
echo 'Usage: convert-tint source.jpg "#FF0000" target.jpg' | |
exit 0 | |
fi | |
source=$1 | |
color=$2 |
This file contains hidden or 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
Nemo actions stored in `~/.local/share/nemo/actions/*.nemo_action` | |
File `install-apk.nemo_action` | |
``` | |
[Nemo Action] | |
# Add menu to *.apk files | |
# | |
# adb install FILENAME | |
# | |
Active=true |
OlderNewer