This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit: http://joquery.com/2012/string-format-for-javascript | |
String.prototype.format = function() { | |
var s = this; | |
for (var i = 0; i < arguments.length; i++) { | |
var reg = new RegExp("\\{" + i + "\\}", "gm"); | |
s = s.replace(reg, arguments[i]); | |
} | |
return s; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// | |
// ('http://www.example.com').withParam('foo', 'bar'); | |
// -> http://www.example.com?foo=bar | |
// | |
// ('http://www.example.com').withParam('foo'); | |
// -> http://www.example.com?foo | |
// | |
// Credit: Lessan Vaezi | |
// (See: http://stackoverflow.com/a/487084/23341) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name constructProxy | |
* | |
* @description | |
* From a source object, generates and returns a proxy object. When a property | |
* in the source object is invoked, it runs the function provided as the getter, | |
* passing it the name of the property invoked as well as the full expression | |
* that was invoked. Properties that are of type 'object' are simply copied over. | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @ngdoc directive | |
* @name radioTabbable | |
* @requires none | |
* @description | |
* Makes individual radio buttons focuseable using the TAB key. | |
* (By default, pressing TAB while on a radio button would have shifted focus to the next control outside of the radio group.) | |
* @usage | |
* <input type="radio" name="radioGroup" value="0" radio-tabbable="" /> | |
* <input type="radio" name="radioGroup" value="1" radio-tabbable="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.radioTabbable = function () { | |
var groups = []; | |
// group the inputs by name | |
$(this).each(function () { | |
var el = this; | |
var thisGroup = groups[el.name] = (groups[el.name] || []); | |
thisGroup.push(el); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\version "2.18.2" | |
\header { | |
title = "16-10-16" | |
composer = "Jonathan A. Conway" | |
} | |
\score { | |
\new PianoStaff << | |
\new Staff { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find ./ -type f -name $1 -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec fluidsynth -i /Library/Audio/Sounds/Banks/GeneralUser\ GS\ v1.47.sf2 $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Inspired by solution by StackOverflow user #18664. | |
# [See: https://apple.stackexchange.com/a/211219/97498] | |
# | |
# Usage: | |
# gif [filename] | |
# | |
# filename - name of a .mov file to convert, excluding .mov extension |