Skip to content

Instantly share code, notes, and snippets.

@vwood
vwood / count_min.py
Created August 16, 2012 05:39
count min
#!/usr/bin/env python2
from math import log
from random import randint
def log2(n):
return log(n) / log(2)
#
# Simple count min
@vwood
vwood / censor.el
Created August 28, 2012 02:18
Censorship in emacs
;;
;; Censor text temporarily in emacs
;;
;; (Using this for screen shots mostly)
(defvar censor-face
'(:foreground "black" :background "black")
"Face to use for censoring")
(defun censor ()
@vwood
vwood / eav.sql
Created October 2, 2012 00:34
EAV in postgres
-- Entity Attribute Value Model in Postgres
CREATE TABLE public.entity (
id serial NOT NULL,
type varchar(25) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE public.defined_attributes (
key varchar(25) NOT NULL,
@vwood
vwood / new_laptop.sh
Last active May 10, 2022 01:28
Setup new ubuntu machine (20.04)
#!/bin/bash
#
# New machine setup for UBUNTU
#
# fixes bad defaults, and installs base packages
#
gsettings set org.gnome.shell.extensions.desktop-icons show-home false
gsettings set org.gnome.shell.extensions.desktop-icons show-trash false
@vwood
vwood / preemployment-questions.txt
Created February 10, 2022 08:50
Preemployment questions
How long has the average employee been working here?
When was the last time someone was promoted?
What technology changes are you most excited about?
What are the companies long term goals?
Who are your main competitors?
How often are releases done?
How many environments do you have? dev/test/staging/prod?
Who does the design of the project?
Where do feature requests come from?