Skip to content

Instantly share code, notes, and snippets.

View martymcguire's full-sized avatar

Marty McGuire martymcguire

View GitHub Profile
@enaeher
enaeher / tiered_archives.rb
Created September 5, 2011 21:49
Tiered Archives plugin
# A quick and dirty plugin for Jekyll by Eli Naeher
#
# This plugin creates a site.years template variable which allow you to group archive links by year and month.
# The structure of site.years is:
# site.years = 2001=>[[post1, post2...], [...]], 2002=>[...]
#
# Usage should look something like this:
# {% for year in site.years %}
# <h2>Year {{ year.first.first.date | date: "%Y" }}</h2>
#include "pins_arduino.h"
#include "wiring_private.h"
void spiwrite(uint8_t c)
{
int8_t i;
// MSB first, clock low when inactive (CPOL 0), data valid on leading edge (CPHA 0)
// Make sure clock starts low
// slow version - built in shiftOut function
@yocontra
yocontra / EventEmitter.coffee
Created May 20, 2012 19:57
Tiny browser/node EventEmitter implementation in coffeescript
class EventEmitter
constructor: ->
@events = {}
emit: (event, args...) ->
return false unless @events[event]
listener args... for listener in @events[event]
return true
addListener: (event, listener) ->
@bockel
bockel / parse-aup.sh
Created September 19, 2012 20:54
Parse audio track times from an audacity .aup project
#!/bin/sh
# Parse audio track times from an audacity .aup project
# Copyright (C) 2012 William Heinbockel <heinbockel@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@zacharyvoase
zacharyvoase / README.md
Last active May 21, 2020 06:19
A li’l class for data URI manipulation in Python.

DataURI.py

Data URI manipulation made easy.

This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.

Parsing

@kylemcdonald
kylemcdonald / BrowseCapture.scpt
Created June 25, 2014 23:40
Records video from your webcam whenever you are visiting a specific site.
global targetDomain
global folderName
-- options
set targetDomain to "dropcam.com"
set folderName to (path to desktop as text) & "Dropcam"
-- main code
global recordingFile
global newMovieRecording
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 16, 2024 21:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
anonymous
anonymous / bubblegum.md
Created September 23, 2014 15:02
Rules for "All out of bubblegum"

All Outta Bubblegum

This game is copyright 2001, Michael "Epoch" Sullivan and Jeffrey Grant. If you want to repost it or whatever, drop me an email.

Characters in All Outta Bubblegum have one stat -- Bubblegum. It's technically a number which varies from 0 through 8, though the designers highly, highly recommend that you don't do anything so banal as write down a number, and, instead, pass out actual sticks of bubblegum to the players. This will also help when you play All Outta Bubblegum drunk, which is, let's be blunt, probably the only time you'd even consider playing this game.

Bubblegum always starts out at 8.

Resolution

@vancluever
vancluever / gnome-tracker-disable.md
Last active May 2, 2024 16:26
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@olih
olih / jq-cheetsheet.md
Last active May 15, 2024 22:26
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq