Skip to content

Instantly share code, notes, and snippets.

View adsgray's full-sized avatar
🎸
workin for the weekend

Andrew Gray adsgray

🎸
workin for the weekend
View GitHub Profile
@merlinmann
merlinmann / wisdom.md
Last active November 14, 2025 03:16
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@amancevice
amancevice / commit-msg
Last active March 23, 2021 11:12
A git hook for mining Amulets https://text.bargains/amulet/
#!/bin/sh
# .git/hooks/commit-msg
chksum="$( printf "%s" "$(< $1)" | sha256sum )"
amulet="\e[5;1;48mYOU HAVE FOUND %s AMULET\e[0m\n"
if grep 8888888888 > /dev/null <<< $chksum ; then
printf "$amulet" "AN IMPOSSIBLE"
elif grep 888888888 > /dev/null <<< $chksum ; then
printf "$amulet" "A MYTHIC"
elif grep 88888888 > /dev/null <<< $chksum ; then
printf "$amulet" "A LEGENDARY"
@jonchurch
jonchurch / glitch_vimify.js
Last active April 18, 2021 01:57
Vim Bindings for Glitch.com editor
// Load your Glitch project, paste this into the javascript console of chrome inspect
// Enjoy vim goodness!
(function () {
var makeCursorFat = function() {
var style = document.createElement('style');
style.textContent =
'div.CodeMirror div.CodeMirror-cursor { ' +
'width: auto; ' +
'border: 0; ' +
@demmer
demmer / slack-messages-by-user.py
Created December 2, 2016 22:59
count slack messages posted to a channel by user
#!/usr/bin/python
'''
Script to count messages by user posted to a channel for a given date range.
Install:
# sudo pip install slackclient
Also you will need to obtain a slack API token:
https://api.slack.com/docs/oauth-test-tokens
@HeinrichHartmann
HeinrichHartmann / GoogleSheetsExample.py
Last active December 5, 2016 20:34
Convenient Access to Google Spreadsheets
# Copyright (c) 2015 Heinrich Hartmann
# MIT License http://choosealicense.com/licenses/mit/
import gdata.spreadsheet.service
class GoogleDriveConnection(object):
def __init__(self, email, password):
self.client = gdata.spreadsheet.service.SpreadsheetsService()
self.client.ClientLogin(email, password)
@tylor
tylor / gist:e1ebf330dd4d1797d6a6
Last active August 29, 2015 14:03
EAST VAN logo generator in bash
VAN=`egrep -i "^...$" /usr/share/dict/words | perl -MList::Util=shuffle -e "print shuffle<STDIN>" | head -n 1 | tr "[:lower:]" "[:upper:]"` && \
LETTER=${VAN:1:1} && \
EAST=`egrep -i "^.${LETTER}..$" /usr/share/dict/words | perl -MList::Util=shuffle -e "print shuffle<STDIN>" | head -n 1 | tr "[:lower:]" "[:upper:]"` && \
echo " ${EAST:0:1}" && \
echo $VAN && \
echo " ${EAST:2:1}" && \
echo " ${EAST:3:1}"
@earldouglas
earldouglas / _README.md
Last active October 3, 2015 22:21
APIcon 2014: Real-World Functional Programming

Real-World Functional Programming

May 28, 2014

This code is a companion to the APIcon presentation Real-World Functional Programming by @jearldouglas and @kelleyrobinson. The slides are available here.

In this code, we compare imperative and functional implementations of a withdraw function that might be used in a banking ATM.

Imperative transactions

@alexandru
alexandru / Ref.scala
Created January 10, 2014 23:09
I'm implementing my own FSM Actors because akka.actor.FSM is disappointing. Part of the implementation is a new way of dealing with data mutation on events. I want Vars, but I want to enforce the scope in which reads or writes can happen. Following is an implementation for scoped, thread-safe Refs that also preserve their previous state before t…
package fsm
import scala.annotation.implicitNotFound
import scala.util.control._
import RefContext._
import Ref._
/**
* Ref is a scoped type-safe mutable reference.
*
@gnarf
gnarf / ..git-pr.md
Last active February 26, 2026 06:25
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@twyatt
twyatt / proguard.cfg
Created July 25, 2012 03:47
An Android ProGuard configuration that works with libGDX.
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable