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
/** | |
* MP_EXT is printed as "EXT" only, all MP_EXT data is skipped | |
*/ | |
static int | |
mp_print_internal(const char **beg) | |
{ | |
switch (mp_typeof(**beg)) { | |
case MP_NIL: | |
mp_next(beg); | |
printf("NIL"); |
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
## | |
## General | |
## | |
# Set correct TERM | |
set-option -g history-limit 10000 | |
set -g default-terminal "screen-256color" | |
# Start non-login shell | |
#set -g default-command "${SHELL}" |
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
# Travis rebuild pusher | |
# requires: travispy | |
# Also you need to have github api token | |
from travispy import TravisPy | |
github_token = '[Your github token]' | |
def travis_auth(token): | |
return TravisPy.github_auth(token) |
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
""" | |
Code golf. Find first prime palindrome | |
115 chars=) | |
""" | |
def golf(n): | |
p=lambda s:s==s[::-1] | |
while True: | |
n+=1 | |
if all([n%i for i in xrange(2,n)]) and p(str(n)):return n |
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 requests | |
from datetime import datetime | |
HTTP_SUCCESS = 200 | |
AGENT = 'CheckPy/0.0.1' | |
class HttpChecker(): | |
""" | |
Simple http checker: |
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 socket import * | |
LOG_MODE = True | |
DEFAULT_REPLY = '<h1>Hello world fork=)</h1>' | |
MAX_RECV = 1024 | |
def server_bind(port, max_conn): | |
s = socket(AF_INET, SOCK_STREAM) | |
s.bind(('', port)) | |
s.listen(max_conn) |