Instantly share code, notes, and snippets.

View cihai-corporate-cla.txt
Cihai Foundation Software Grant and Corporate Contributor License Agreement
("Agreement"), v1.0
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to Cihai Software Foundation. ("Cihai"). Except
for the license granted herein to Cihai and recipients of software distributed
by Cihai, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
View cihai-individual-cla.txt
Cihai Software Foundation Individual Contributor License Agreement
("Agreement"), v1.0
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to Cihai Software Foundation. ("Cihai"). Except
for the license granted herein to Cihai and recipients of software distributed
by Cihai, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
View flask_pdb.py
def drop_into_pdb(app, exception):
import sys
import pdb
import traceback
traceback.print_exc()
pdb.post_mortem(sys.exc_info()[2])
# somewhere in your code (probably if DEBUG is True)
flask.got_request_exception.connect(drop_into_pdb)
View bs4-border-radius-mixin.scss
// Single side border-radius
@mixin border-radius($radius: $border-radius) {
@if $enable-rounded {
border-radius: $radius;
}
}
@mixin border-top-radius($radius) {
@if $enable-rounded {
View create_datapackage.py
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Based off http://frictionlessdata.io/guides/creating-tabular-data-packages-in-python/
For use on https://github.com/cihai/unihan-tabular
License: MIT
"""
from __future__ import (absolute_import, division, print_function,
View examples.md

clone oxygine

❯ git clone https://github.com/oxygine/oxygine-framework oxygine

separate examples into oxygine-examples repo

add remote to new repo

View hi2.c
#include <stdio.h>
// run: clang -S hi2.c
int main(){
printf("HI");
}
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
View fabfile.py
# -*- coding: utf-8 -*-
"""Proof of concept to use saltstack's pure modules and states with fabric::
fab list_packages print_specs -H <ip> --user=<user>
On my vagrant environment:
fab list_packages print_specs -H <ip> --password=vagrant --user=vagrant
"""
View docutils_to_gh.rst