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
| /* | |
| This code takes a 2D transformation matrix described as a one-dimensional array | |
| (in column order, top to bottom and left to right) and decomposes it using the dojo | |
| matrix library. This input matrix should produce a 45-deg X skew: | |
| 1 1 0 | |
| 0 1 0 | |
| 0 0 1 | |
| The output of decompose() looks like this: |
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
| <!doctype html> | |
| <!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
| <html> | |
| <head> | |
| <title>iOS 8 web app</title> | |
| <!-- CONFIGURATION --> |
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
| // Add to 'Default (OSX).sublime-keymap' | |
| // Reverse selected lines. | |
| [ | |
| { "keys": ["super+shift+r"], "command": "permute_lines", "args": {"operation": "reverse"} } | |
| ] |
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
| javascript:(function() { | |
| var bookmarklet = { | |
| init: function() { | |
| this.parse(); | |
| }, | |
| parse: function() { | |
| page = ""; | |
| /* you must be viewing songs ie. http://www.rdio.com/people/nloko/collection/songs/ | |
| when exporting a collection and this will only export the songs loaded in view, |
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
| // Do checks for minimum requirements | |
| if (!XMLHttpRequest || !JSON) { | |
| throw Error('Browser does not support the minimum requirements of ' + | |
| 'XMLHttpRequest, JSON' + | |
| '. Try adding modernizer to polyfill.'); | |
| } | |
| function http(method, url, data, success) { | |
| var r = new XMLHttpRequest(); | |
| r.open(method, url, 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
| // adapted from http://www.youtube.com/watch?v=qNM0k522R7o | |
| extern vec2 size; | |
| extern int samples = 5; // pixels per axis; higher = bigger glow, worse performance | |
| extern float quality = 2.5; // lower = smaller glow, better quality | |
| vec4 effect(vec4 colour, Image tex, vec2 tc, vec2 sc) | |
| { | |
| vec4 source = Texel(tex, tc); | |
| vec4 sum = vec4(0); |
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
| /*************************************************** | |
| * Simple and elegant, no code complexity | |
| * Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records) | |
| * (This disadvantage should go away as we add optimizations to the core product) | |
| ***************************************************/ | |
| var fb = firebase.database.ref(); | |
| /** | |
| * @param {string} emailAddress |
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
| (function($){ | |
| /** | |
| * Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2 | |
| * within the comfortable framework of the jquery ajax request, with full support for promises. | |
| * | |
| * Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list | |
| * of potential transports (so it gets first dibs if the request passes the conditions within to provide the | |
| * ajax transport, preventing the standard transport from hogging the request), and the * indicates that | |
| * potentially any request with any dataType might want to use the transports provided herein. | |
| * |
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
| {url:'stun:stun01.sipphone.com'}, | |
| {url:'stun:stun.ekiga.net'}, | |
| {url:'stun:stun.fwdnet.net'}, | |
| {url:'stun:stun.ideasip.com'}, | |
| {url:'stun:stun.iptel.org'}, | |
| {url:'stun:stun.rixtelecom.se'}, | |
| {url:'stun:stun.schlund.de'}, | |
| {url:'stun:stun.l.google.com:19302'}, | |
| {url:'stun:stun1.l.google.com:19302'}, | |
| {url:'stun:stun2.l.google.com:19302'}, |
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 to export data in all sheets in the current spreadsheet as individual csv files | |
| * files will be named according to the name of the sheet | |
| * author: Michael Derazon | |
| */ | |
| function onOpen() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}]; | |
| ss.addMenu("csv", csvMenuEntries); |