SemanticText is a proposal for a new text-based writing syntax for the web (and much more).
Status: Draft - Request for comments
Revision: 2.0.0
| """ | |
| Yet another Brainfuck interpreter written in Python (3.4). | |
| Plot twist: this interpreter craft Python bytecode from the Brainfuck code and execute it. | |
| Yep, dynamic Python bytecode generation from Brainfuck source code. Why? Because I can. | |
| """ | |
| from bytecode import Instr, Label, Bytecode | |
| def bf_rle_encode(input_str): |
| def slice_pagination_range(page_range, page_number, slice_range): | |
| """ | |
| Slice the given ``page_range`` to +/- ``slice_range`` values around the given ``page_number``. | |
| Center the slice on the given ``page_number`` (one based). | |
| First and last values are always in the output slice. | |
| If required, ellipsis are added as ``None`` values. | |
| """ | |
| nb_pages = len(page_range) |
| from collections import defaultdict | |
| from PIL import ( | |
| Image, | |
| ImageDraw, | |
| ImageFont | |
| ) | |
| img = Image.new('1', (8, 16)) | |
| font = ImageFont.truetype('arial.ttf', 10) |
| """ | |
| Unicoder - The unicode nightmare for developers. | |
| """ | |
| import os | |
| import sys | |
| import random | |
| import codecs | |
| import argparse | |
| import unicodedata |
| /** | |
| * Marlin 3D Printer Firmware | |
| * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | |
| * | |
| * Based on Sprinter and grbl. | |
| * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm | |
| * | |
| * This program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or |
| """ | |
| Incremential backup script for NGINX logs files. | |
| """ | |
| import re | |
| import sqlite3 | |
| import argparse | |
| from hashlib import sha256 | |
| import pdb |
| from PIL import Image, ImageSequence | |
| # Output (max) size | |
| size = 320, 240 | |
| # Open source | |
| im = Image.open("in.gif") | |
| # Get sequence iterator | |
| frames = ImageSequence.Iterator(im) |
| """ | |
| Serial protocol decoder for UNI-T UT61C (GS). | |
| """ | |
| import serial | |
| BV = lambda x: 1 << x | |
| FLAGS = { | |
| BV(0): 'BPN', # Bargraph rule |
| """ | |
| Export all data related to the given user. | |
| """ | |
| from django.contrib.auth.models import User | |
| from django.core.serializers import serialize | |
| from django.core.management.base import BaseCommand, CommandError | |
| class Command(BaseCommand): |