- http://lostechies.com/derickbailey/2012/06/04/anders-hejlsberg-is-right-you-cannot-maintain-large-programs-in-javascript/
- http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
- http://en.wikipedia.orgi/wiki/Separation_of_concerns
- Single Responsibility Principle: http://www.objectmentor.com/resources/articles/srp.pdf
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
// Alternative JavaScript Syntax | |
Person = :(name, address) { @name!, @address! } | |
Person::inspect = :{ <: "{@name} lives at {@address}" } | |
tj := Person('TJ', '314 Bessborough ave') | |
bob := Person('Bob', 'Some place') | |
[tj, bob].each(:(person){ print(person.inspect()) }) |
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
// an IIFE that illustrates different implementations | |
// of $.post() with Promises | |
// | |
// Check out jsFiddle `jQuery and Promises with UI animation` | |
// - demonstrates $.Deferrred() and custom $.when() | |
// - @ http://jsfiddle.net/ThomasBurleson/RTLr6/179/ | |
// | |
var onSubmitFeedback = (function () { | |
var target = $("#container").append("<div class='spinner'>"); |
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
// Using Casperjs to screenshot an entire Facebook Post */ | |
var casper = require('casper').create({ | |
clientScripts: [ | |
'jquery.js' | |
] | |
}); | |
//login to facebook | |
casper.start('https://www.facebook.com/', function() { | |
this.fill('#login_form', { email: 'email', pass: 'password' }, true); |
Here are a list of headless browsers that I know about:
- [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
- [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
- [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
- [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
- [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
- [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
- [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
- [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
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
# Extract frames. One every 1 second(s) | |
ffmpeg -i video.mp4 -r 1 scenes/scene_%04d.png | |
# Convert png to png8 to decrease size. | |
for f in $(ls scenes | grep -i png); do convert "scenes/$f" "PNG8:scenes/$f"; done; | |
# Create animation | |
convert -delay 100 -loop 0 scenes/*.png animation.gif |
I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.
I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
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
//To run Q.js examples: | |
// 1. Open a new browser tab in Chrome and turn on developer toolbar (or open any http site). | |
// 2. Copy/Paste this gist in the console and hit enter to run the snippets. | |
// Based on the inspiration from samples @ https://github.com/kriskowal/q | |
//////////////////////////////////////////////////////////////////// | |
//////////////////////////////////////////////////////////////////// |
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 | |
#Start time | |
StTime="00:02:31" | |
#Length of video | |
LenV="00:00:05" | |
#Quantity images per sec | |
R="4" | |
#Width of images | |
WIDTH="600" |
OlderNewer