Skip to content

Instantly share code, notes, and snippets.

Avatar

Yulong Ruan ruanyl

  • Helsinki, Finland
View GitHub Profile
View stock.json
This file has been truncated, but you can view the full file.
@ruanyl
ruanyl / image-arraybuffer.js
Created Jan 31, 2018 — forked from candycode/image-arraybuffer.js
Create a jpg image from ArrayBuffer data
View image-arraybuffer.js
// Simulate a call to Dropbox or other service that can
// return an image as an ArrayBuffer.
var xhr = new XMLHttpRequest();
// Use JSFiddle logo as a sample image to avoid complicating
// this example with cross-domain issues.
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true );
// Ask for the result as an ArrayBuffer.
xhr.responseType = "arraybuffer";
@ruanyl
ruanyl / Unicode table
Created May 4, 2017 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
View Unicode table
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@ruanyl
ruanyl / create-random-file.md
Created Jul 4, 2016
create multiple files with random content in Mac OS
View create-random-file.md
@ruanyl
ruanyl / Jenkins_Protractor_Headless_Chrome_Setup_Ubuntu_14.04.md Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04
View Jenkins_Protractor_Headless_Chrome_Setup_Ubuntu_14.04.md

Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04

Update Ubuntu

sudo apt-get update
sudo apt-get upgrade

Install Java

@ruanyl
ruanyl / base64.js
Created Dec 22, 2015
base64 encoding for browser
View base64.js
var b64encode = function(str) {
return root.btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
return String.fromCharCode('0x' + p1);
}));
};
View gist:5a0deb5443f10ed2ab84

Using Homebrew to manage Node.js and io.js installs on OSX

Having both Node.js and io.js installed with NVM was giving me a load of problems, mainly with npm. So I uninstalled NVM and manage Node.js and io.js with homebrew.
Heres how.

Install Node.js and io.js

$ brew install node
$ brew install iojs

@ruanyl
ruanyl / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.