Skip to content

Instantly share code, notes, and snippets.

View yurrriq's full-sized avatar
🙈
I may be slow to respond.

Eric Bailey yurrriq

🙈
I may be slow to respond.
View GitHub Profile
@yurrriq
yurrriq / script.sh
Last active July 28, 2017 19:18
Copy git diff of file
#! /usr/bin/env bash
git --no-pager diff -w $1 | pbcopy
@yurrriq
yurrriq / script.sh
Created June 26, 2017 02:46
Change Gnucash language
### Force English ###
defaults write org.gnucash.Gnucash AppleLanguages '(en)'
defaults write org.gnucash.Gnucash AppleLocale 'en_US'
### Revert to system settings ###
defaults delete org.gnucash.Gnucash AppleLanguages
defaults delete org.gnucash.Gnucash AppleLocale
@yurrriq
yurrriq / eio.el
Created June 4, 2017 18:02 — forked from canweriotnow/eio.el
elisp exercise helper
;;; eio.el --- Support for creating Elisp exercises
;; Author: Jason Lewis
;; Created: 5 June 2015
;; This file is not part of GNU Emacs.
;;; Commentary:
;;
;; Provides utility functions for stubbing elisp exercises
@yurrriq
yurrriq / CGRect+Subract.swift
Created May 5, 2017 18:07
Subtract a CGRect from another
import CoreGraphics
public extension CGRect {
func subtract(_ subtrahend: CGRect, edge: CGRectEdge) -> CGRect {
guard intersects(subtrahend) else { return self }
let intersectSize: CGSize = intersection(subtrahend).size
let distance: CGFloat = (edge == .minXEdge || edge == .maxXEdge)
@yurrriq
yurrriq / nix-deps.sh
Created April 4, 2017 17:43
nix dependencies
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
deps () {
nix-store --query --references $1
}
deriver () {
nix-store -qd $1
}
@yurrriq
yurrriq / script.sh
Created March 21, 2017 01:17
List MD5 RSA fingerprints
#! /usr/bin/env bash
for pubkey in ~/.ssh/*.pub; do
ssh-keygen -E md5 -lf $pubkey
end
@yurrriq
yurrriq / travis_long.sh
Created March 20, 2017 09:27
Keep Travis CI alive by printing every minute
#!/bin/bash
# Taken from:
# https://github.com/mmhelloworld/idris-jvm/blob/aa5049a/bin/travis_long
$* &
pidA=$!
minutes=0
while true; do sleep 60; ((minutes++)); echo -e "\033[0;32m$minutes minute(s) elapsed.\033[0m"; done &
#(set! paper-alist
(cons '("my size" . (cons (* 2 8.5 in) (* 4 11 in)))
paper-alist))
\setOption naptaker.staff-size #26
\setOption naptaker.paper-size #"my size"
\setOption naptaker.paper-orientation #'landscape
@yurrriq
yurrriq / nix_antiquotation.md
Created March 6, 2017 09:19
Nix Antiquotation notes

Antiquotation (${expr}) is supported in indented strings.

Since ${ and '' have special meaning in indented strings, you need a way to quote them. ${ can be escaped by prefixing it with '' (that is, two single quotes), i.e., ''${. '' can be escaped by prefixing it with ', i.e., '''. Finally, linefeed, carriage-return and tab characters can be written as ''\n, ''\r, ''\t.

https://nixos.org/nix/manual/#idm140737318143872

@yurrriq
yurrriq / default.nix
Created February 28, 2017 11:26
git-flow (nvie/gitflow) package
{ pkgs, stdenv, fetchFromGitHub, makeWrapper, getopt, git }:
with pkgs.lib;
stdenv.mkDerivation rec {
name = "git-flow-${version}";
version = "0.4.1";
src = fetchFromGitHub {
owner = "nvie";