This gist shows how to test events on Backbone views using Mocha, Chai, Sinon, and Require.js. The directory structure of the project being referenced, based on that of the Canto front end, can be found in my earlier gist about a related testing topic.
❤️🔥
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 reloadCSS() { | |
| const links = document.getElementsByTagName('link'); | |
| Array.from(links) | |
| .filter(link => link.rel.toLowerCase() === 'stylesheet' && link.href) | |
| .forEach(link => { | |
| const url = new URL(link.href, location.href); | |
| url.searchParams.set('forceReload', Date.now()); | |
| link.href = url.href; | |
| }); |
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
| #!/bin/sh | |
| if [ $# != 2 ]; then | |
| echo "\nchris k's git update automater sh script. Edit to put a bunch of \`git add blah'" | |
| echo "lines in the body then evoke with the branch name and commit description\n" | |
| echo "Usage: $0 <branch_name> <\"Description of update\">\n" | |
| echo " branch_name: the name of the git branch to be created" | |
| echo " Description: Text for: git commit -m \"Description of update\"" | |
| echo "" | |
| echo "Example:" | |
| BRANCH="core_override" |
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
| What is the release date for 2.0? | |
| No exact release date yet. They don't want what happened with 1.2.They want to | |
| make sure they get it done right for 2.0 so they are not setting a date yet. | |
| What is the plan for having a migration path for 2.0? How much rewriting of 1.x | |
| apps will need to be done to migrate to 2.0? | |
| Mishko said that there will definitely be a migration plan for 2.0. They dont know |
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
| // Import Ale's fantastic Sketch Sandbox | |
| // https://github.com/bomberstudios/sketch-sandbox | |
| #import 'sketch-sandbox.js' | |
| // Are we on a page or an artboard? | |
| var page = doc.currentPage(); | |
| var canvas = page.currentArtboard() ? page.currentArtboard() : page; | |
| // Define the location of the file you want to import, using file:// protocol | |
| var fileURL = NSURL.URLWithString("file:///Users/johndoe/Downloads/my_cat.svg"); |
I've heard this before:
What I really get frustrated by is that I cannot wrap
console.*and preserve line numbers
We enabled this in Chrome DevTools via blackboxing a bit ago.
If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.
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 dispatch = InspectorBackendClass.Connection.prototype.dispatch; | |
| InspectorBackendClass.Connection.prototype.dispatch = function() { | |
| if (arguments && arguments.length > 0) { | |
| var message = arguments[0]; | |
| var object = message ? JSON.parse(message) : {}; | |
| console.log.apply(console,['events', object]); | |
| } | |
| dispatch.apply(this, arguments); | |
| } |
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
| mov-to-gif() { | |
| ffmpeg -i $1 -vf "scale=1024:-1:flags=lanczos" -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=0 --delay=7 # | |
| } |
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
| #!/bin/sh | |
| palette="./palette.png" | |
| # speed - setpts=0.15*PTS, | |
| # crop - ffmpeg -i in.mov -filter:v "crop=480:600:320:80" out.mov | |
| filters="fps=25,scale=640:-1:flags=lanczos" | |
| ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette |