Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# aquamacs-editor: my $EDITOR for Aquamacs. Starts Aquamacs, waits
# for emacs-server to load, then runs emacsclient with the given
# arguments. If data is piped to stdin, it's buffered to a temporary
# file and passed to emacsclient instead. Waits for 'C-x #' unless
# invoked with -n.
#
# sstephenson 2010-09-12
require "tempfile"
@aphyr
aphyr / gist:1375435
Created November 18, 2011 02:55
Riak-client transparent failover
Each . is a successful get/put. Rescued ... shows where an exception was
raised and retried by the client. [float, float, float] are the error_rates
of the three nodes, exponentially decaying. When I kill a node, the exception
is caught and retried transparently. If any were to fail three times
successively, an X would be printed.
Throughout this test I'm restarting nodes left and right at random. So long
as fewer than two crash at once, no errors are raised.
This works so long as all operations in a given block are replayable.
@bkerley
bkerley / repl.zsh
Created July 5, 2013 15:22
riak-admin repl
#!/usr/bin/env zsh
RIAK_ADMIN_PATH='/Users/bkerley/erlang/riak/riak/dev/dev1/bin/riak-admin'
echo -n "riak-admin> "
while read inputline; do
echo `$RIAK_ADMIN_PATH $inputline`
echo -n "riak-admin> "
done
curl --get 'https://api.twitter.com/1.1/statuses/show.json' --data 'id=353218566180442112' --header 'Authorization: OAuth oauth_consumer_key="DCtwdGNS38Sr9JNXwS53cQ", oauth_nonce="87c91da7f4d6d61ec9d81fd0fb7c7980", oauth_signature="%2FD09dk9pNQ4uj3szTpYWThetfc8%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1373049118", oauth_token="7865582-sVflpbIO5WH1IDf2oSWlUFIfhNsRMq1aZQivXB3gI0", oauth_version="1.0"' | python -mjson.tool
anonymous
anonymous / PWMfanController.c
Created June 4, 2010 04:47
/*This code for a PIC12F615 compiles in mikroC for PIC http://www.mikroe.com
It takes an analog value from a dash-mounted potentiometer and drives a MOSFET proportional to the input. The MOSFET pulses the low-side of a blower motor in
a 1997 Mitsubishi Mirage, providing 128 speeds*/
void main() {
int anin=0, ramped=255;
unsigned long temp = 0;
@tbeseda
tbeseda / wobble.css
Created February 8, 2012 00:12
slowly wobble an element with CSS -- shamelessly ripped from love.travis-ci
/* just webkit, 'cause yeah... */
@-webkit-keyframes wobble {
0% { -webkit-transform: rotate(0deg); }
20% { -webkit-transform: rotate(2deg); }
50% { -webkit-transform: rotate(-2deg); }
100% { -webkit-transform: rotate(0deg); }
}
.wobble { -webkit-animation: wobble 5s infinite; }

I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal

I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at

@0xabad1dea
0xabad1dea / singularthey.md
Last active June 18, 2022 18:01
Singular They in Technical English

Guidelines for Singular They in Technical English

by 0xabad1dea, December 2014

This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.

What is Singular They?

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

@technoweenie
technoweenie / github_oauth_busy_developer_guide.md
Created May 30, 2010 18:34
GitHub OAuth Busy Developer's Guide

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access: