Skip to content

Instantly share code, notes, and snippets.

View franklinjavier's full-sized avatar

Franklin Javier franklinjavier

View GitHub Profile
// 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()) })
@ThomasBurleson
ThomasBurleson / gist:1910025
Created February 25, 2012 18:45
Using $.post() with Promises
// 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'>");
@jonaslund
jonaslund / fbScrape.js
Created August 15, 2012 10:18
Casperjs script to screenshot an entire Facebook Post
// 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);
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

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.
@madeingnecca
madeingnecca / gist:5580161
Created May 14, 2013 22:25
MULTIMEDIA - video to gif
# 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
@millermedeiros
millermedeiros / osx_setup.md
Last active May 1, 2024 20:46
Mac OS X setup

Setup Mac OS X

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...

@addyosmani
addyosmani / examples.md
Last active February 23, 2016 18:22
Object.observe() examples from my talk

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'];
@guptag
guptag / Q.js Examples
Last active April 4, 2021 06:22
Q.js examples - Small snippets to understand various api methods in Q.js
//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
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
@jemsgit
jemsgit / cutmov2gif.sh
Last active August 20, 2022 22:21
cut movie and make gif
#!/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"