Skip to content

Instantly share code, notes, and snippets.

View Bystroushaak's full-sized avatar
🦊
Rapid Offensive Unit

Bystroushaak Bystroushaak

🦊
Rapid Offensive Unit
View GitHub Profile
#! /usr/bin/env python3
import sys
import json
from random import random
from collections import Counter
from collections import defaultdict
def normalize(counter):
s = float(sum(counter.values()))
[translation:info] 2.7.10 (5.1.2+dfsg-1~16.04, Jun 16 2016, 17:37:42)
[PyPy 5.1.2 with GCC 5.3.1 20160413]
[platform:msg] Set platform with 'host' cc=None, using cc='gcc', version='Unknown'
[translation:info] Translating target as defined by src/tinySelf/target
[translation] translate.py configuration:
[translation] [translate]
targetspec = src/tinySelf/target
[translation] translation configuration:
[translation] [translation]
gc = incminimark
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
import sys
import sh
IGNORE: " |\n";
root: (expression ["\."])* expression;
object: ["("] slots? sends* [")"];
block: ["["] slots? sends* ["]"];
return: ["^"] expression;
expression: IDENTIFIER | value | object | block | send;
def partition(thelist, n):
return [
thelist[i:(i + n)]
for i in range(0, len(thelist), n)
]
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Imports =====================================================================
import random
# Variables ===================================================================
VOWELS = list("aeiouáéíóúůyý")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Created: 27.09.13
#
# Imports =====================================================================
import ast
import types # NoneType
import pprint
splitBy: word = (| current <- 0. full_size. out |
out: list copy.
full_size: self size.
full_size <= word size ifTrue: [^out].
word size = 0 ifTrue: [^out].
[current <= full_size] whileTrue: [
self
findSubstring: word
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import random
# Variables ===================================================================
class Template(object):
pass
class DescrWrapper(object):
def __init__(self, fn):
self.fn = fn
def __call__(self, *args, **kwargs):
return self.fn(self, *args, **kwargs)