The goal of these Gists is for me to have a place to look up all things Haskell. Hopefully they will be useful to other people as well.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Key zram params: | |
# mem_limit: maximum amount of ram it will ever be allowed to eat. | |
# disksize: filesytem size, may be larger than mem_limit, because of compression. | |
# comp_algorithm: lz4 gives about 2x compression for most builds. | |
# backing_dev: device to dump uncompressable pages to, must be set before size. Must use a script to drop pages, not automatic. | |
# | |
# Key mkfs options: | |
# '-e remount-ro' to go read-only on errors, it stops the build properly | |
# '-m 0' to skip root-only reserved 5% of space | |
# '-O ^has_journal' to skip journal. it's disposable FS and we will never run fsck on it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys; from PIL import Image; import numpy as np | |
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@')) | |
if len(sys.argv) != 4: print( 'Usage: ./asciinator.py image scale factor' ); sys.exit() | |
f, SC, GCF, WCF = sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), 7/4 | |
img = Image.open(f) | |
S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) ) | |
img = np.sum( np.asarray( img.resize(S) ), axis=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Process.h> | |
void setup() { | |
Bridge.begin(); | |
Serial.begin(9600); | |
while (!Serial) | |
; | |
Serial.print("Patching..."); |
The goal of these Gists is for me to have a place to look up all things Python so I can stop trying to use Perl or Ruby syntax when writing Python code. Hopefully they will be useful to other people as well.
- [Setting up environment] (https://gist.github.com/vpayno/6338724)
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
- Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration file for dircolors, a utility to help you set the | |
# LS_COLORS environment variable used by GNU ls with the --color option. | |
# Copyright (C) 1996, 1999-2010 Free Software Foundation, Inc. | |
# Copying and distribution of this file, with or without modification, | |
# are permitted provided the copyright notice and this notice are preserved. | |
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the | |
# slackware version of dircolors) are recognized but ignored. | |
# Possibly useful emacs-lisp to show the colors: | |
# (font-lock-add-keywords nil '(("38;5;\\([1-9][0-9]+\\)" (1 `(face (:background ,((lambda (c) (let* ((x (- (string-to-int c) 16)) (arr '("00" "5f" "87" "af" "d7" "ff")) (blue (mod x 6)) (green (mod (/ x 6) 6)) (red (mod (/ x 36) 6))) (if (> x 215) (let* ((z (- x 216)) (s (nth z '("08" "12" "1c" "26" "30" "3a" "44" "4e" "58" "62" "6c" "76" "80" "8a" "94" "9e" "a8" "b2" "bc" "c6" "d0" "da" "e4" "ee" "ff")))) (concat "#" s s s)) (concat "#" (nth red arr) (nth green arr) (nth blue arr))))) (match-stri |