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 os | |
import codecs | |
import json | |
""" $ cat *json | |
{"welcome": { "fr": "bienvenue", "es": "holla " }} | |
""" | |
class Translator(object): | |
def __init__(self,path=".",_format="json"): | |
try: |
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 python3.3 | |
import signal as s | |
from time import sleep | |
import fcntl | |
from time import asctime as _asctime | |
from random import randint | |
import os,sys | |
asctime= lambda : _asctime()[11:19] | |
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
#include <signal.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <bits/signum.h> | |
int val=0; | |
int pipefd[2]; | |
#define RPIPE 0 |
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
#include <signal.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <bits/signum.h> | |
#include <string.h> | |
int pipefd[2]; | |
#define RPIPE 0 |
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 python3.3 | |
import signal as s | |
from time import sleep | |
import fcntl | |
import select | |
from time import asctime as _asctime | |
from random import randint | |
import os,sys | |
asctime= lambda : _asctime()[11:19] |
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 python | |
# -*- coding: utf-8 -*- | |
from time import sleep | |
def sleep(*a): | |
pass | |
class BlackBox(object): | |
def __init__(self, name): | |
self.name = name | |
self._in = dict() |
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/python | |
# -*- coding: utf-8 -*- | |
#WTFPL | |
"""Trying lame cosinus on text | |
to create the mysoginie and troll input text file | |
you need *nix | |
fortunes / fortunes-fr | |
and then | |
fortune mysoginie -m '' | egrep -v -r "^%" | egrep -v '\-\+\-' > myso-fr.txt | |
fortune tribune-linuxfr -m '' | egrep -v -r "^%" | egrep -v '\-\+\-' > troll.txt |
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 collections import MutableMapping | |
from json import dumps | |
class Merger(dict): | |
def merge(self, to_merge): | |
"""Merging to dict, to_merge dict keys being prioritar on initial dict | |
""" | |
if not isinstance(to_merge,MutableMapping): | |
raise Exception("What Did I just read?") | |
for k, v in to_merge.items(): |
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
============================= test session starts ============================== | |
platform linux2 -- Python 2.7.3 -- pytest-2.3.5 -- /home/gaffer/py27/bin/python2.7 | |
collecting ... collected 178 items / 2 skipped | |
test/test_channel.py:13: test_basic PASSED | |
test/test_channel.py:41: test_process_events PASSED | |
test/test_channel.py:67: test_stats PASSED | |
test/test_controller.py:45: test_basic PASSED | |
test/test_controller.py:73: test_basic_error PASSED | |
test/test_controller.py:85: test_command_not_found PASSED |
This file has been truncated, but you can view the full file.
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
execve("/home/gaffer/py27/bin/py.test", ["py.test", "-v"], [/* 30 vars */]) = 0 | |
brk(0) = 0x12b5000 | |
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fed186c6000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/etc/ld.so.cache", O_RDONLY) = 3 | |
fstat(3, {st_mode=S_IFREG|0644, st_size=61688, ...}) = 0 | |
mmap(NULL, 61688, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fed186b6000 | |
close(3) = 0 | |
open("/lib64/libpthread.so.0", O_RDONLY) = 3 | |
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\\\0z5\0\0\0"..., 832) = 832 |