Skip to content

Instantly share code, notes, and snippets.

View tabjy's full-sized avatar

Kangcheng Xu tabjy

  • Toronto, ON
  • 07:13 (UTC -04:00)
View GitHub Profile
@tabjy
tabjy / mimetype.json
Last active April 15, 2020 07:01 — forked from lsauer/gist:5196979
JavaScript List of selected MIME types (JSON)
"lsauer.com , lo sauer 2013"
"JavaScript List of selected MIME types"
"A comprehensive MIME List is available here: https://gist.github.com/lsauer/2838503"
"mime": {
"a": "application/octet-stream",
"ai": "application/postscript",
"aif": "audio/x-aiff",
"aifc": "audio/x-aiff",
"aiff": "audio/x-aiff",
@tabjy
tabjy / node-and-npm-in-30-seconds.sh
Created December 9, 2015 07:04 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tabjy
tabjy / NeteaseMusicCryptor.js
Last active December 11, 2015 02:49
网易云音乐相关API返回数据格式
/*jslint node: true*/
'use strict';
/**
* Created by stkevintan(https://github.com/stkevintan/Cube/blob/master/src/model/Crypto.js) on 15-7-19.
* With modifications made by Tab/jy
*/
const Crypto = require('crypto');
const BigInt = require('big-integer');
function extend(des, src, override) {
if (src instanceof Array) {
for (var i = 0, len = src.length; i < len; i++)
this._extend(des, src[i], override);
}
for (var ii in src) {
if (override || !(ii in des)) {
des[ii] = src[ii];
}
}