Skip to content

Instantly share code, notes, and snippets.

View mathias's full-sized avatar

Matt Gauger mathias

View GitHub Profile
For all major modes:
52317 31.82% self-insert-command €..ÿ
17695 10.76% next-line C-n, <down>
15124 9.20% previous-line C-p, <up>
11891 7.23% left-char <left>
11699 7.12% paredit-backward-delete
11364 6.91% right-char <right>
4378 2.66% delete-backward-char
4336 2.64% mwheel-scroll <C-wheel-down>, <S-wheel-down>, <wheel-down>, <C-wheel-up>, <S-wheel-up>, <wheel-up>
# lib/decent_exposure/draper_strong_parameters_strategy.rb:
class DraperStrongParametersStrategy < DecentExposure::StrongParametersStrategy
def resource
super.decorate
end
end
# app/controllers/articles.rb
@mathias
mathias / README.md
Last active December 30, 2015 22:43

Forked from the dashing Verbinski plugin, which uses the excellent Forecast.io API.

require 'bundler/setup'
require 'pry'
require 'rethinkdb'
require 'benchmark'
include Benchmark
include RethinkDB::Shortcuts
$conn = r.connect(:host => 'localhost', :port => 28015)
// Change the following to reflect your pin choices:
int ledPin = 13; // the pin that the LED is attached to
int switchPin = 2; // Switch connected to digital pin 2
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
void setup() {
Serial.begin(9600); // Serial console is nice for debugging
// Change the following to reflect your pin choices:
int ledPin = 13; // the pin that the LED is attached to
int switchPin = 2; // Switch connected to digital pin 2
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
void setup() {
Pry::Commands.create_command "html5tidy" do
description "Print indented, colorized HTML from the input: html5tidy [ARGS]"
command_options requires_gem: ['nokogiri']
# opt is a Slop object, see https://github.com/injekt/slop/blob/master/README.md
def options(opt)
end
def process
.
.
.
.
.
.
(ns hum-demo
(:require [hum.core :as hum]
[dommy.core :as dommy])
(:use-macros [dommy.macros :only [node sel1]]))
(def ctx (hum/create-context))
(def vco (hum/create-osc ctx :square))
(def vcf (hum/create-biquad-filter ctx))
(def output (hum/create-gain ctx))
@mathias
mathias / README.md
Last active December 27, 2015 07:59

Description

This is a simple job for a Number widget to display your team's Coderwall rank. (As seen on https://coderwall.com/leaderboard )

Be sure to set the CODERWALL_TEAM variable with the name of your team as it appears in the URL for your team.

Since the Coderwall rank only seems to change daily, I recommend bumping up the scheduler to only request the JSON as infrequently as you can stand. The Coderwall API is free and doesn't require authentication, and I'd like it if it stayed that way versus them requiring OAuth or some other mechanism to ensure people aren't killing their API.

Insert something like this into your Dashboard: