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
[diff] | |
tool = pycharm | |
[difftool "pycharm"] | |
cmd = /usr/local/bin/pycharm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read | |
[merge] | |
tool = pycharm | |
keepBackup = false | |
[mergetool "pycharm"] | |
cmd = /usr/local/bin/pycharm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED" |
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
viktor@haree-nb /tmp/test/greenlet (git)-[master] % ./run-tests.py | |
running build_ext | |
Linking /tmp/test/greenlet/build/lib.linux-x86_64-2.7/greenlet.so to /tmp/test/greenlet/greenlet.so | |
python 2.7.4 (64 bit) using greenlet 0.4.0 from /tmp/test/greenlet/greenlet.so | |
test_dead_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_dealloc_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_inactive_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_version (tests.test_version.VersionTests) ... ok | |
test_exception_disables_tracing (tests.test_tracing.TracingTests) ... ok | |
test_greenlet_tracing (tests.test_tracing.TracingTests) ... ok |
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
# 1 "greenlet.c" | |
# 1 "<command-line>" | |
# 1 "/usr/include/stdc-predef.h" 1 3 4 | |
# 1 "<command-line>" 2 | |
# 1 "greenlet.c" | |
# 1 "greenlet.h" 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
.file "greenlet.c" | |
.text | |
.p2align 4,,15 | |
.type green_is_gc, @function | |
green_is_gc: | |
.LFB142: | |
.cfi_startproc | |
cmpq $-1, 24(%rdi) | |
je .L3 | |
xorl %eax, %eax |
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 math | |
import hashlib | |
def bytes_to_hex(str): | |
return ''.join( [ "%02x" % ord( x ) for x in str] ).strip() | |
def chunk_hashes(str): | |
""" | |
Break up the byte-string into 1MB chunks and return sha256 hashes | |
for each. |
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 | |
if [ -z $1 ] | |
then | |
echo "Usage: include filename" 1>&2 | |
exit 1 | |
fi | |
filename="/usr/include/$1" | |
if [ ! -f $filename ]; then | |
echo "File not found" 1>&2 |
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
from django.http import HttpResponse | |
from mimetypes import guess_type | |
import settings | |
import re, os | |
class XSendFileError(Exception): | |
pass | |
class XSendFileResponse(HttpResponse): | |
def __init__(self, file_path, content_type=None): |
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 | |
# MySQL backup script | |
# Creates database dump file for each database. | |
# Created: 2010-09-27 | |
# config | |
BACKUP_USER=backup | |
BACKUP_DIR=/var/backups/mysql | |
LOGFILE=/var/log/mysql_backup |
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 | |
# Resursively change owner to www-data | |
# | |
# Created: 2011-05-12 | |
# Author: Viktor Stiskala <viktor@stiskala.cz> | |
LOGFILE=/var/log/wwwdata | |
## Add following line tu sudoers file (using visudo command) in order to allow | |
## users from www-data group to change owners under /var/www/ |
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
/* | |
Requires browscap.ini configuration, more info at http://php.net/manual/en/function.get-browser.php | |
*/ | |
$this->template->registerHelper('browser', function($s) { | |
$brs = get_browser($s); | |
if($brs === false) | |
return 'N/A'; | |
// ex.: Firefox 3.6/Linux | |
return $brs->browser . ' ' . $brs->version . '/' . $brs->platform; | |
}); |