Skip to content

Instantly share code, notes, and snippets.

View vpayno's full-sized avatar

Victor Payno vpayno

View GitHub Profile
@clsn
clsn / .dir_colors
Created February 3, 2012 05:54
Coolest .dir_colors ever
# 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
@olivierlacan
olivierlacan / gist:4062929
Last active February 10, 2024 10:57 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

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.

Why you should care about screencasting?

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.

  1. 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.
@jaymcgavren
jaymcgavren / javascript_objects.md
Last active September 12, 2018 09:23
In this screencast, Jay McGavren gives you a clear, no-nonsense look at Javascript objects. You'll learn how properties and functions are woven together to make a complete object. You'll learn what's special about constructor functions (not that much), and how prototypes form the basis for creating new objects. If you're ready to take the next s…

Objects

To create a new object, use the new keyword followed by a call to a constructor function. Javascript provides the Object() constructor out-of-the-box:

var toilet = new Object();

Properties

Once you have an object, you can set and get properties on it, like this:

@vpayno
vpayno / Python Cheat Sheets - Index.md
Last active December 21, 2015 17:08
Python Cheat Sheets - Index

Python Cheat Sheets

by Victor Payno

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.

@sgk
sgk / PatchYun.ino
Created September 20, 2013 17:50
Patch Yun to disable WiFi function.
#include <Process.h>
void setup() {
Bridge.begin();
Serial.begin(9600);
while (!Serial)
;
Serial.print("Patching...");
@cdiener
cdiener / asciinator.py
Last active January 5, 2023 17:24
Convert image to ascii art
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)
@kyledrake
kyledrake / ferengi-plan.txt
Last active October 3, 2024 15:12
How to throttle the FCC to dial up modem speeds on your website using Nginx
# 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 / {
@vpayno
vpayno / haskell-cheat-sheets-index.md
Last active August 29, 2015 14:05
Haskell Cheat Sheets - Index

Haskell Cheat Sheets

by Victor Payno

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.

Table of Contents

@gyakovlev
gyakovlev / etcudevrules.d10-zram.rules
Created May 30, 2021 20:56
/etc/udev/rules.d/10-zram.rules
# 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