Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Ariya Hidayat ariya

💭
I may be slow to respond.
Block or report user

Report or block ariya

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ariya on github.
  • I am ariya (https://keybase.io/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
ariya / wrapper.md
Last active Aug 29, 2015
ES5 and ES6 parser
View wrapper.md

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.

@ariya
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
ariya / Vagrantfile
Last active Aug 29, 2015
Vagrantfile CentOS for PhantomJS 2
View Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "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
ariya / Twenty Thousands Leagues inside the Optical Fiber.md
Created Apr 25, 2014
Twenty Thousands Leagues inside the Optical Fiber
View Twenty Thousands Leagues inside the Optical Fiber.md

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
ariya / image.js
Created Jan 30, 2013
PhantomJS script to print the source of the first image
View image.js
var page = require('webpage').create();
page.content = '<html><body><img src="foo.png">';
console.log(page.evaluate(function () {
return document.images[0].src;
}));
phantom.exit();
@ariya
ariya / find-github-commits.sh
Created Sep 19, 2012
Find some Git commits and print out the subject and GitHub link
View find-github-commits.sh
#!/bin/bash
if [ "$#" == "0" ]; then
echo "Usage: find-github-commits issue-number"
exit 1
fi
repo=$(git config --get remote.origin.url | cut -d ':' -f 2 | sed 's/....$//')
for commit in $(git rev-list --reverse origin/master)
View vimrc
set number
set ruler
syntax on
color darkblue
set nowrap
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
@ariya
ariya / gist:2950246
Created Jun 18, 2012
null stack in ChromeClient
View gist:2950246
diff --git a/src/qt/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/qt/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index c8e40e6..fe98941 100644
--- a/src/qt/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/qt/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -305,7 +305,9 @@ void ChromeClientQt::addMessageToConsole(MessageSource src, MessageType type, Me
// the MessageType value isn't useful - it will be LogMessageType for both errors
// and log messages.
if (level == ErrorMessageLevel) {
- QString stack = callStack->buildInspectorArray()->toJSONString();
+ QString stack = "[]";
@ariya
ariya / license.txt
Created Apr 8, 2012
Malicious PHP masqueraded as WordPress license.txt
View license.txt
<?php
$GLOBALS['_1660021129_'] = Array(
'sprintf',
'ip2long',
'substr_count',
'sleep',
'strpos',
'preg_replace',
'stripos',
'gethostbyaddr',
You can’t perform that action at this time.