View fork
/usr/local/bin/fish -c "$*" > ~/tmp/fish_forks/last.log 2>&1 &
mv ~/tmp/fish_forks/last.log ~/tmp/fish_forks/$pid.log
disown $pid
#!/usr/bin/env python3
# Nick Sweeting 2017 | MIT License
# Usage:
# 1. Download pocket export from to ril_export.html
# 2. Run ./ ril_export.html
# 4. Archive is saved in "pocket" folder
# Dependencies (chrome, python3, wget):
# wget -q -O - | sudo apt-key add -
import os
import sys
"""Perform a UNIX double-fork to detach, and re attach process to init so it's not a child of web worker"""
# do the UNIX double-fork magic, see Stevens' "Advanced
# Programming in the UNIX Environment" for details (ISBN 0201563177)
pid = os.fork()
if pid > 0:
def autocast(func):
"""Tries to cast any parameters with type hints to the type defined.
Will not act if more than one type is defined.
Try to avoid using this, instead type-cast within your function to the desired types."""
def autocast_wrapper(*args, **kwargs):
sig = signature(func)
def convert(arg, param):

CockroachDB + Django ORM


  1. fork django/contrib/postgres driver
  2. patch blocking postgres compatibility issues
  3. review with cockroachdb team to see if any issues can be fixed by cockroach
  4. review with django team
  5. merge adapter as separate cockroachdb adapter
  6. write docs, any admin work, etc.
import bleach
import json as jsonlib
from django import template
register = template.Library()
def json(value):
"""safe jsonify filter, bleaches the json string using the bleach html tag remover"""
public class ScopeTest {
public static void main(String[] args) {
int result = 0;
addNumbers(12, 24);
from django.views import View
from django.shortcuts import render
class Leaderboard(View):
title = 'Leaderboard'
template = 'ui/react_base.html'
component = 'pages/leaderboard.js'
def get(self, request):
View leaderboard.js
import React from 'react'
import ReactDOM from 'react-dom'
const Leaderboard = ({users}) =>
<h1>Featured Players</h1>
{ =>
<a href={`/user/${user.username}/`}>
View react_base.html
{% extends "ui/base.html" %}
{% block title %}{{title}}{% endblock %}
{% block inner %}
<div id="react">
<!-- Contents get replaced by mounted React.Component -->
<i class="fa fa-lg fa-spinner fa-spin"></i><br><br>
<i class="pending">Loading components...</i><br><br>