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/bash | |
LANG=C LC_ALL=C \ | |
find . -not \( -name .git -prune -o -name .hg -prune -o -name .svn -prune \) \ | |
-type f -exec sed -i '' 's/[[:blank:]]*$//' '{}' \; |
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
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageMath | |
def paste_composite(original, paste): | |
""" | |
Вставляет в первое изображение второе, с учетом альфаканала обоих. | |
Оба изображения должны быть в формате RGBA. | |
""" |
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
{ | |
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It | |
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as | |
you did, the {internet|net|web} will be {much more|a lot more} | |
useful than ever before.| | |
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} | |
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? | |
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. | |
Thanks.| |
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
import re | |
import random | |
CURLY_RE = re.compile( "\{(.*?)\}" ) | |
def spam( filename, n=1 ): | |
file = open(filename, "r") |
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
var lib = function() { | |
/* lib() is the same as lib.a() */ | |
return lib.a.apply(lib, arguments) | |
} | |
lib.a = function() { | |
/* do somethig, e.g. */ | |
console.log('lib.a() called with', arguments) | |
/* allow chaining */ | |
return lib |
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/bash | |
# +----------------------------------------------------------------------+ | |
# | | | |
# | Mount the root file system / with the option noatime | | |
# | | | |
# | By Philipp Klaus <http://blog.philippklaus.de> | | |
# | Tip found on <http://blogs.nullvision.com/?p=275> | | |
# | | | |
# +----------------------------------------------------------------------+ |
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
{ | |
"apache": { | |
"process": "/usr/sbin/httpd", | |
"start": "sudo apachectl start", | |
"stop": "sudo apachectl stop" | |
}, | |
"mysql": { | |
"process": "/usr/local/Cellar/mysql/5.6.12/bin/mysqld", | |
"start": "mysql.server start > /dev/null", | |
"stop": "mysql.server stop > /dev/null" |
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
import re | |
import sys | |
def wrap(filename): | |
print(filename) | |
with open(filename) as f: | |
text = f.read() | |
ms = re.findall(r"goog\.require\('(.+?)'\)", text) | |
if not ms: | |
ms = ['box2d'] |
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/bash | |
find . -not \( -name CVS -prune -or -name .git -prune \) -type f -print0 \ | |
|xargs -0 sed -Ei '' 's/[[:space:]]{1,}$//' |
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/bash | |
sed -E 's/[[:<:]]SetXYZ?[[:>:]]/Set/g' "$@" |