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
\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
$.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
/** | |
* @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
/** | |
* @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
// 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
// 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
NDM Javascript Code Test Solutions | |
================================== | |
1. Fix the below Javascript code so that the correct index is printed to console.log on each iteration. | |
Solution: | |
(function() { | |
var index, | |
length = 10; |
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
// Reload (or initialize) addThis social share buttons. | |
// IMPORTANT: make sure you put in a correct pubid on line 7. | |
window.addthis_reload = function () { | |
if (!window.addthis) { | |
// Load addThis, if it hasn't already been loaded. | |
window['addthis_config'] = { 'data_track_addressbar' : false }; | |
$('body').append('<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={YOUR PUBID HERE}"></script>'); | |
} else { | |
// Already loaded? Then re-attach it to the newly rendered set of social icons. | |
// And reset share url/title, so they don't carry-over from the previous page. |