This file contains hidden or 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
| # Show/Hide all icons on the Desktop, even if you have 'hidden files on' | |
| # Usage: | |
| # $ cleandesk => hides all icons | |
| # $ showdesk => ahem, SHOWS all icons | |
| alias cleandesk="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" | |
| alias showdesk="defaults write com.apple.finder CreateDesktop -bool true && killall Finder" |
This file contains hidden or 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
| string_a = "Hello"; | |
| string_b = "Hello world"; | |
| string_c = "Hello: how are you"; | |
| string_d = "I would say Hello: to you"; | |
| /** | |
| * Create a regular expression. | |
| * | |
| * The "^" character means 'must start with', |
This file contains hidden or 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
| // Assumes that your script is somewhere within a folder called "adobe_scripts" and | |
| // that you store your includable files relative to `adobe_scripts/lib/` | |
| // indexOf polyfill from https://gist.github.com/atk/1034425 | |
| [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b<c&&(!(b in this)||this[b]!==a);b++);return b^c?b:-1;}); | |
| var Libraries = (function (libPath) { | |
| return { | |
| include: function (path) { | |
| if (!path.match(/\.jsx$/i)) { |
This file contains hidden or 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
| var jqExists = function (version) { | |
| var existingVersion = jQuery && jQuery.fn.jquery; | |
| if (!existingVersion) return false; | |
| current = existingVersion.split("."); | |
| required = version.split("."); | |
| for (var i=0; i<required.length; i++) { | |
| if (required[i] === "*") return true; |
This file contains hidden or 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
| var myWidgetCreator = (function ($, lib) { | |
| var Creator = {}; | |
| Creator.create = function (args) { | |
| // 'this' is the captured jQuery object | |
| // because we called 'apply' from the widget | |
| this.html(Creator.doSomething()); | |
| }; | |
This file contains hidden or 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
| <?php | |
| // This is the index.php file with some kind of router | |
| $router->get("/jscacher/:key", function ($key) { | |
| echo json_encode(["cached" => apc_fetch($key)]); | |
| }); | |
| $router->post("/jscacher", function () use ($router) { | |
| $request = $router->getRequest(); |
This file contains hidden or 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
| /** | |
| * Scientist.js | |
| * | |
| * A small helper library for working with Google Analytics. | |
| * | |
| * @author Jason Rhodes | |
| * @version 0.2 | |
| * | |
| */ | |
| var Scientist = function (analytics) { |
This file contains hidden or 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
| // Throttle: only execute callback if more than 'wait' ms have passed since last successful call | |
| var throttle = function (wait, func) { | |
| var last; | |
| return function () { | |
| var now = new Date(); | |
| if (now - last < wait { | |
| return; | |
| } | |
| func.apply(this, arguments); | |
| last = now; |
This file contains hidden or 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
| <script src="http://hub.jhu.edu/assets/shared/js/hubwidget.2.0.min.js"></script> | |
| <div id="hubWidget"></div> |
This file contains hidden or 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
| // Assumes you have loaded the jQuery plugin found at: https://raw.github.com/johnshopkins/jquery.hubwidget/master/js/jquery.hubwidget.js | |
| jQuery(document).ready(function ($) { | |
| $(".my-widget-div").hubWidget({ | |
| // optional options | |
| }); | |
| }); |