Skip to content

Instantly share code, notes, and snippets.

var Promise = require('bluebird');
const path = require('path');
const j = path.join;
const fs = Promise.promisifyAll(require('fs-extra'));
const wiredep = require('wiredep');
const home = require('user-home');
const hashCacheFile = j(home, '.quikr', 'buildCache.json');
const hasher = require('folder-hash');
const _console_log_ = console.log;
const _console_info_ = console.info;
@pwang2
pwang2 / publish.sh
Last active October 21, 2016 02:59
#!/bin/bash
# script to publish the related version to npm
function replaceJsonProp {
replaceInFile $1 '"('$2')"[ ]*:[ ]*"'$3'"' '"\1": "'$4'"'
}
function replaceInFile {
sed --in-place=.tmp -E "s/$2/$3/" $1
rm $1.tmp
}
'use strict';
var fork = require('child_process').fork,
guid = require('mout/random/guid'),
log = require('quikr-log')(),
_ = require('underscore'),
Promise = require('bluebird'),
cpus = require('os').cpus(),
path = require('path'),
QUEUE_LIMIT = 32,
DEFAULT_TIMEOUT = 20000; //ms
We can't make this file beautiful and searchable because it's too large.
index,airportname,city,country,iata,icao,latitude,longitude,altitude,timezone,dst,tzregion,type,source
1,"Goroka Airport","Goroka","Papua New Guinea","GKA","AYGA",-6.081689834590001,145.391998291,5282,10,"U","Pacific/Port_Moresby","airport","OurAirports"
2,"Madang Airport","Madang","Papua New Guinea","MAG","AYMD",-5.20707988739,145.789001465,20,10,"U","Pacific/Port_Moresby","airport","OurAirports"
3,"Mount Hagen Kagamuga Airport","Mount Hagen","Papua New Guinea","HGU","AYMH",-5.826789855957031,144.29600524902344,5388,10,"U","Pacific/Port_Moresby","airport","OurAirports"
4,"Nadzab Airport","Nadzab","Papua New Guinea","LAE","AYNZ",-6.569803,146.725977,239,10,"U","Pacific/Port_Moresby","airport","OurAirports"
5,"Port Moresby Jacksons International Airport","Port Moresby","Papua New Guinea","POM","AYPY",-9.443380355834961,147.22000122070312,146,10,"U","Pacific/Port_Moresby","airport","OurAirports"
We can't make this file beautiful and searchable because it's too large.
airline,airlineid,sourceairport,sourceairportid,destairport,destairportid,codeshare,stop,equipment
2B,410,AER,2965,KZN,2990,,0,CR2
2B,410,ASF,2966,KZN,2990,,0,CR2
2B,410,ASF,2966,MRV,2962,,0,CR2
2B,410,CEK,2968,KZN,2990,,0,CR2
2B,410,CEK,2968,OVB,4078,,0,CR2
2B,410,DME,4029,KZN,2990,,0,CR2
2B,410,DME,4029,NBC,6969,,0,CR2
2B,410,DME,4029,TGK,\N,,0,CR2
[
"ATL",
"PEK",
"DXB",
"LAX",
"HND",
"ORD",
"LHR",
"HKG",
"PVG",
@pwang2
pwang2 / .tmux.conf
Last active October 17, 2022 23:53
.tmux.conf
setw -g mode-keys vi
setw -g base-index 1
setw -g pane-base-index 1
setw -g aggressive-resize off
set -g status on
set -g status-position top
set -g escape-time 0
set -g prefix C-a
set -g focus-events on
@pwang2
pwang2 / init-linux.sh
Last active January 31, 2024 20:49
linux init
if [ $UID -eq 0 ]; then
echo "*****************************************************"
echo "$(tput setaf 1)DO NOT RUN AS sudo $(tput sgr 0)"
echo "*****************************************************"
exit 1
fi
ZPLUGINS=$HOME/.oh-my-zsh/custom/plugins
BREW=/home/linuxbrew/.linuxbrew
HAS_MAC=$(uname -a | grep -c Darwin)
@pwang2
pwang2 / .zshrc_shared
Last active February 1, 2024 15:17
.zshrc_shared
TERM="tmux-256color"
ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
KEYTIMEOUT=1
DISABLE_AUTO_TITLE=true
DISABLE_MAGIC_FUNCTIONS=true
IS_MACOS=$(uname -s | grep -i "darwin" | wc -l)
if [ $IS_MACOS -eq 1 ]; then
BREW_PREFIX="/usr/local"
[Desktop Entry]
Exec=bash -c "PID=$(lsof -ti:5901) && [ ! -z $PID ] && kill -9 $PID; ssh -fN -p 2930 -L 5901:localhost:5901 pwang2@65.52.0.118 && /usr/bin/xtigervncviewer -SecurityTypes None :1"
Name=wx
GenericName=Wechat on VNC
Icon=terminal
Terminal=false
Type=Application
Categories=Utilities;Application;