Skip to content

Instantly share code, notes, and snippets.

@iansym
iansym / eyed3.sh
Last active April 7, 2020 19:06
Using eyeD3 to add cover art
for f in *mp3; do eyed3 --encoding=utf8 --to-v2.4 --add-image cover.jpg:OTHER $f; done
@iansym
iansym / .git_commit_msg.txt
Created October 8, 2015 14:43
git commit message template
# If applied, this commit will...
#........|.........|.........|.........|.........$
# Why is this change being made?
#........|.........|.........|.........|.........|.........|.........|.$
# Provide links to any relevant tickets, URLs or other resources
#........|.........|.........|.........|.........|.........|.........|.$
@iansym
iansym / 0_reuse_code.js
Created October 5, 2015 17:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@iansym
iansym / .zshrc
Last active December 15, 2015 11:49
zsh autocorrect helpers
if [ -f ~/.zsh_nocorrect ]; then
while read -r COMMAND; do
alias $COMMAND="nocorrect $COMMAND"
done < ~/.zsh_nocorrect
fi
@iansym
iansym / jsonview-solarized.css
Last active September 13, 2022 21:33
JSON View solarized theme for Chrome Extension
body {
background-color: #002b36;
color: #839496;
font-size: 14px;
white-space: pre !important;
font-family: "Source Code Pro", monospace;
}
.property {
font-weight: bold;
@iansym
iansym / main.html
Created December 6, 2010 22:35
can we on-demand js using pubsub and namespaced functions/methods/whatever
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>test</title>
<script src="jquery-1.4.4.js"></script>
<script src="jquery.pubsub.js"></script>
<script>
// namespace
@iansym
iansym / calcAge.js
Created October 8, 2010 15:28
Simple age calculation function
function calcAge(YYYY,MM,DD) {
var today = new Date(),
todayYYYY = today.getFullYear(),
todayMM = today.getMonth() + 1,
todayDD = today.getDate();
return (todayYYYY - YYYY) - (todayMM < MM || (todayMM == MM && todayDD < DD) ? 1 : 0);
}
@iansym
iansym / jquery.pubsub.js
Created July 28, 2010 16:06
PubSub functionality
/**
* Package: jQuery PubSub
* a lightweight and fast jQuery Publish/Subscribe system
* based on the jQuery plugin by Peter Higgins (dante@dojotoolkit.org)
* http://higginsforpresident.net/js/jq.pubsub.js
*/
(function(window) {
var subscriptions = {},
cache = {},
we,