Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
bsod_win9x() {
NUM_COLUMNS=$(tput cols)
NUM_ROWS=$(tput lines)
HEADER_OFFSET_X=$(($NUM_COLUMNS / 2 - 4))
HEADER_OFFSET_Y=$(($NUM_ROWS / 2 - 3))
TEXT_OFFSET=$(($NUM_COLUMNS / 2 - 37))
clear
#!/usr/bin/env python3
import os
import sys
from PIL import Image
BRAILLE_OFFSET = 0x2800
def braillify(image_path, threshold):
# simple expression evaluator
import ast
import operator
import contextlib
OPERATORS = {
ast.Add: operator.add,
ast.And: operator.and_,
ast.Or: operator.or_,
@for $i from 1 through 100 {
@if $i % 15 == 0 {
#{$i} { is: "fizzbuzz"}
} @else if $i % 3 == 0 {
#{$i} { is: "fizz" }
} @else if $i % 5 == 0 {
#{$i} { is: "buzz" }
} @else {
#{$i} { is: "-" }
}
/* Tcl in ~ 500 lines of code.
*
* Copyright (c) 2007-2016, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
html {
lang: en;
head {
title {
"hello world"
}
}
body {
import json
from collections import OrderedDict
class Pipfile(object):
def __init__(self, filename='Pipfile'):
self.filename = filename
self.sources = []
self.groups = OrderedDict({
'default': []
def rawsql(queryset):
compiler = queryset.query.get_compiler(using=queryset.db)
sql, params = compiler.as_sql()
with compiler.connection.cursor() as cursor_wrapper:
cursor = cursor_wrapper.cursor
cursor_type = str(type(cursor)).lower()
if 'psycopg2' in cursor_type or 'pymysql' in cursor_type:
return cursor.mogrify(sql, params)
elif 'mysqldb' in cursor_type:
db = cursor._get_db()
(defmacro rpn (&rest tokens)
(let ((st (list)))
(dolist (x tokens (pop st))
(if (symbolp x)
(let* ((op2 (pop st))
(op1 (pop st)))
(push (list x op1 op2) st))
(push x st)))))
(assert (equal 3 (rpn 1 2 +)))
BABY(1fun) BABY(1fun)
NAME
baby — create new process from two parents
SYNOPSIS
baby −sex [m|f] [−name name]