Skip to content

Instantly share code, notes, and snippets.

@mybuddymichael
mybuddymichael / count-clj-sloc.sh
Last active December 10, 2015 01:48 — forked from andrewvc/count-clj-sloc.sh
Count the lines of code in a Clojure project (`src` and `test` directories only).
# Count SLOC
export SLF=`mktemp -t cljsloc`; \
find src test -name "*.clj" \
| xargs egrep -v "(^[[:space:]]*$|^[[:space:]]*;)" \
| cut -d: -f1 > $SLF && echo "Files"; \
uniq -c $SLF; \
echo "Total" `cat $SLF | wc -l`; \
rm $SLF
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix.
;;
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;;
;; * :import refers Java classes to the current namespace.
;;

Sketch Plugins

A list of Sketch plugins hosted at GitHub, in no particular order.

@mybuddymichael
mybuddymichael / README.md
Last active August 29, 2015 14:15 — forked from mbostock/.block
  1. If you haven’t already: brew install ffmpeg gifsicle imagemagick.
  2. Open QuickTime Player.
  3. File > New Screen Recording.
  4. Record.
  5. Save as recording.mov.
  6. mkdir frames
  7. cd frames
  8. ffmpeg -i ../recording.mov -r 24 recording-%03d.png
  9. convert recording-001.png palette.gif
  10. convert -dither none -remap palette.gif recording-*.png recording-uncompressed.gif

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@mybuddymichael
mybuddymichael / fix-homebrew-npm.md
Last active September 15, 2015 22:45 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@mybuddymichael
mybuddymichael / overlapper.py
Created July 5, 2021 14:59 — forked from phu54321/overlapper.py
Fix for cloze overlapper (2.1.28+)
# -*- coding: utf-8 -*-
# Cloze Overlapper Add-on for Anki
#
# Copyright (C) 2016-2019 Aristotelis P. <https://glutanimate.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version, with the additions