Skip to content

Instantly share code, notes, and snippets.

@norm
norm / Makefile
Created July 16, 2015 13:50
Minimum Viable Python-only automatic SASS compilation
.PHONY: css
CSS=static/screen.css
css: $(CSS)
clean:
rm $(CSS)
$(CSS): static/%.css: sass/%.scss
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
margin: 0;
padding: 0;
}
h1 {
margin: 0 0 2em 0;
@norm
norm / custom.css
Last active December 27, 2015 01:49
Mainstream fourth wall display repositories
#pulls li.age-aging,
#pulls li.age-old {
background: #9Fa098;
}
@norm
norm / gist:6140268
Created August 2, 2013 14:28
100 characters wide preview
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1 2 3 4 5 6 7 8 9 0
1

Accept no meetings days

I operate a policy of having days in which I try hard to not have meetings. If you're reading this, chances are you've looked at my calendar and are wondering what kind of meeting takes all day and happens so frequently. It's not an actual meeting, it is a reservation of the day.

When you're operating on the maker's schedule, meetings are a disaster. A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in.

Maker's Schedule, Manager's Schedule by Paul Graham

If you still need to book a meeting with me on a reserved day, go ahead. I'll accept it if I think it's more important than having time for coding and thinking and solving hard problems.

@norm
norm / s3
Created May 13, 2012 08:38
s3 command line script
#!/usr/bin/env perl
use Modern::Perl;
use Date::Manip;
use File::Basename;
use List::MoreUtils qw( any );
use Net::Amazon::S3;
use Pod::Usage;
@norm
norm / gist:969350
Created May 12, 2011 20:18
Patch to cdparanoia
diff --git a/interface/cdda_interface.h b/interface/cdda_interface.h
index 4731c82..912cf4d 100644
--- a/interface/cdda_interface.h
+++ b/interface/cdda_interface.h
@@ -80,7 +80,7 @@ typedef struct cdrom_drive{
/* functions specific to particular drives/interfaces */
int (*enable_cdda) (struct cdrom_drive *d, int onoff);
- int (*read_toc) (struct cdrom_drive *d);
+ int (*read_toc) (struct cdrom_drive *d, int quiet);
@norm
norm / pipe_runner
Created April 10, 2011 22:30
run multiple processes that output to named pipes
#!/usr/bin/env perl
#
# A script to enable running multiple background processes that output
# to named pipes from one controlling window.
#
# To install:
#
# 1. Install pre-requisite modules from CPAN:
#
# sudo cpanm Capture::Tiny Config::Std Proc::Fork
@norm
norm / etcstatic
Created March 27, 2011 22:28
Perl plackup script to serve up static content, used by dotjs.
#!/usr/bin/env perl
#
# Perl script to serve up ~/etc/static on localhost. I use this in
# conjunction with my fork of the "dotjs" Safari extension (found
# at https://github.com/norm/dotjs.safariextension) to serve up
# JS and CSS.
#
# Requires Plack and Plack::Middleware::Header. Best installed with cpanm
# ("sudo cpanm Plack Plack::Middleware::Header"). Cpanm, and instructions
# on installing it can be found at http://cpanmin.us/.
# Patch for mini_httpd to apply:
# a) X-Real-IP support; found at http://nginx.org/pipermail/nginx/2010-October/023255.html
# b) Fix "conflicting types for getline"; found at http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=7;bug=552844
# http://nginx.org/pipermail/nginx/2010-October/023255.html
--- mini_httpd.c 2009-11-20 12:10:55.000000000 +0300
+++ mini_httpd.c 2009-11-20 12:13:59.000000000 +0300
@@ -186,6 +186,7 @@
static char* pidfile;
static char* charset;
static char* p3p;