Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Ariya Hidayat ariya

I may be slow to respond.
View GitHub Profile
ariya / Twenty Thousands Leagues inside the Optical
Created Apr 25, 2014
Twenty Thousands Leagues inside the Optical Fiber
View Twenty Thousands Leagues inside the Optical

Twenty Thousands Leagues inside the Optical Fiber

What actually happens as we post a hundred-character tweet, run npm install, chat with our remote colleagues, and let the operating system updates itself? Numerous interactions are triggered in each of the 7 OSI communication layers but one thing that is not often discussed enough is the very important physical layer. The complicated network of undersea fiber optic cables, with its record-breaking transmission capacity (light can easily send the contents of a stack of Bluray discs in a few milliseconds), is the foundation of modern communication for our civilization.

This talk gives a historical journey of this remarkable achievement, a series of scientific milestones in the recent human history. It covers the topic on how to trap photons inside a hair-thin strand of glass, modulate them to carry some useful information in 40 different wavelengths, force the photons to travel thousands of miles, and finally stitch back the bits and pieces for a full r

ariya / Vagrantfile
Last active Aug 29, 2015
Vagrantfile CentOS for PhantomJS 2
View Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "centos"
config.vm.provision "shell",
inline: "yum -y update && yum -y install gcc gcc-c++ make flex bison gperf ruby openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 3072]
ariya / global.expected.txt
Created Jul 28, 2014
Sample test for PhantomJS 2
View global.expected.txt
typeof phantom is object
typeof phantom.version is object
typeof phantom.args is object
typeof phantom.args.length is number
typeof phantom.scriptName is string
typeof phantom.exit is function
phantom.version.major is 2
phantom.version.minor is 0
phantom.version.patch is 0
ariya /
Last active Aug 29, 2015
ES5 and ES6 parser

es5parser requires esprima 1.x and exports as es5parser.

es6parser requires esprima 2.x and exports as es6parser.

es7parser requires esprima-fb 7.x and exports as es7parser.

esparser requires all es5parser and es6parser and es7parser, switches the parser based on the language option.


Keybase proof

I hereby claim:

  • I am ariya on github.
  • I am ariya ( on keybase.
  • I have a public key whose fingerprint is 1CE9 829F 2840 5D6E B3D2 F474 FC22 3713 DB2D 17EE

To claim this, I am signing this object:

ariya / post.js
Created May 28, 2011
Example using HTTP POST operation
View post.js
var page = new WebPage(),
server = '',
data = 'universe=expanding&answer=42';, 'post', data, function (status) {
if (status !== 'success') {
console.log('Unable to post!');
} else {
ariya / pizza.js
Created May 29, 2011
Find pizza in New York using Google Local
View pizza.js
var page = new WebPage();
page.onConsoleMessage = function (msg) {
};'', function (status) {
if (status !== 'success') {
console.log('Unable to access network');
} else {
ariya / netsniff.js
Created Jun 7, 2011
onResourceRequested example
View netsniff.js
var page = new WebPage(), address, resources = [];
if (phantom.args.length === 0) {
console.log('Usage: netsniff.js <some URL>');
} else {
address = phantom.args[0];
page.onLoadStarted = function () {
page.startTime =;
View result.txt
All resources:
"method": "GET",
"url": "",
"time": 1
"method": "GET",
"url": "",
View commit.log
Increase the goat teleporter timeout threshold to 100 because the old
value of 10 caused problems for extremely overweight goats. Tests show
that the largest goat in existence should be teleported in 50ms, so...
TEST=Try loading an overweight goat and confirm the teleporter works.
You can’t perform that action at this time.