Skip to content

Instantly share code, notes, and snippets.

#sha1sum (part of coreutils)
#xxd (part of vim)
#put ulread, ulwrite and amiitool in the same directory as this script
if [ $# -ne 2 ]
'''Routines for manipulating the Dock'''
import os
import subprocess
from Foundation import NSURL
from Foundation import CFPreferencesAppSynchronize
from Foundation import CFPreferencesCopyAppValue
from Foundation import CFPreferencesSetAppValue
View Peach v1 API

Peach ( API Endpoints

Peach is hot right now so I poked around their API using

As of the last update, this seems to be a fairly extensive/complete list of v1 endpoints, but feel free to submit revisions to this gist with any others you find!


View The Three Go Landmines.markdown

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
acolas / delete-old-tweets.js
Last active Oct 24, 2018
Delete old tweets by date, delete all favs, delete all retweets
View delete-old-tweets.js
// Delete old tweets via,
var token = "yourToken";
$( "#stream-items-id li" ).each(function(index) {
var tweetToDeleteId = $(this).data("item-id");
if (tweetToDeleteId !== undefined) {
var xhr = new XMLHttpRequest();"POST", "");
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("_method=DELETE&authenticity_token=" + token + "&id="+tweetToDeleteId);

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets!

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

nojvek / Tinder Auto-liker
Last active Aug 19, 2020
Tinder Auto-liker script
View Tinder Auto-liker
// Licence: WTFPL !
$fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>");
// Do the magic.
$tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate
$authToken = "X-Auth-Token: $tinderToken\r\nAuthorization: Token token=\"$tinderToken\"\r\n";
callumacrae /
Last active Jan 10, 2020
Build tools written in JavaScript
victorquinn / promise_while_loop.js
Last active Mar 29, 2020
Promise "loop" using the Bluebird library
View promise_while_loop.js
var Promise = require('bluebird');
var promiseWhile = function(condition, action) {
var resolver = Promise.defer();
var loop = function() {
if (!condition()) return resolver.resolve();
return Promise.cast(action())
nodesocket / bootstrap.flatten.css
Last active Sep 8, 2020
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for, so your milage may vary.
View bootstrap.flatten.css
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
You can’t perform that action at this time.