Skip to content

Instantly share code, notes, and snippets.

@sirjofri
sirjofri / Makefile
Last active January 3, 2022 15:34
static site generator-chan
include config.mk
SITES=$(sort $(notdir $(basename $(wildcard $(SITESPATH)/*.*.inc))))
MKDFILES=$(sort $(basename $(wildcard $(SITESPATH)/*.*.md)))
LANG=$(subst .,,$(suffix $(SITES)))
all:
@$(PRECMD)
@make -s markdown
@make -s html
@csswizardry
csswizardry / README.md
Last active June 16, 2024 13:44
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@urschrei
urschrei / hexagram.py
Last active October 4, 2019 08:42
Generate and dump a hexagram in PNG format
# -*- coding: utf-8 -*-
# Requires PIL (pillow) and NumPy
# Copyright (C) Stephan Hügel, 2016
# License: MIT
import sys
from PIL import Image
import numpy as np
@toolness
toolness / adventures-in-python-core-dumping.md
Last active May 25, 2024 04:10
Adventures in Python Core Dumping

Adventures in Python Core Dumping

After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.

@kchapelier
kchapelier / hg_sdf.glsl
Created December 16, 2015 16:27
Port of hg_sdf ( http://mercury.sexy/hg_sdf/ ) to OpenGL ES 2.0 for compat with WebGL
////////////////////////////////////////////////////////////////
//
// HG_SDF
//
// GLSL LIBRARY FOR BUILDING SIGNED DISTANCE BOUNDS
//
// version 2015-12-15 (initial release)
//
// Check http://mercury.sexy/hg_sdf for updates
// and usage examples. Send feedback to spheretracing@mercury.sexy.
@alanpeabody
alanpeabody / my_app.ex
Last active June 11, 2024 06:32
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@pokstad
pokstad / gaereverseproxy.go
Last active October 24, 2021 09:35
Google App Engine reverse proxy in Golang
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package goengine
import (
"io"
@UniIsland
UniIsland / list-manually-installed-packages.sh
Created February 8, 2014 08:20
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.
@wooorm
wooorm / treebankTokenizer.js
Created January 19, 2014 12:58
Penn Treebank Tokenizer in JavaScript. Based on both the Sed script by Robert McIntyre ([cis.upenn.edu][1]), and the Python port by Edward Loper and Michael Heilman ([nltk.org][2]). [1]: http://www.cis.upenn.edu/~treebank/tokenizer.sed [2]: http://nltk.org/_modules/nltk/tokenize/treebank.html
/**
* Author: Titus Wormer <tituswormer@gmail.com>
* URL: http://wooorm.com/penn-treebank-tokenizer-in-javascript.html
*
* The Treebank tokenizer uses regular expressions to tokenize text as in
* Penn Treebank. This implementation is a based on both the Sed script
* written by Robert McIntyre (available at
* [http://www.cis.upenn.edu/~treebank/tokenizer.sed]), and the Python port
* by Edward Loper and Michael Heilman (available at
* [http://nltk.org/_modules/nltk/tokenize/treebank.html]).
@pascalpoitras
pascalpoitras / config.md
Last active June 23, 2024 15:33
My WeeChat configuration

WeeChat Screenshot

Mouse


enable