Skip to content

Instantly share code, notes, and snippets.

View Neil-UWA's full-sized avatar

Neil Neil-UWA

  • Originate
  • Hangzhou, China
View GitHub Profile
@Neil-UWA
Neil-UWA / tmux-cheatsheet.markdown
Created March 29, 2017 01:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Neil-UWA
Neil-UWA / gist:5bf23ee99903a05f67ad23a4767abab1
Created December 22, 2016 05:51 — forked from allex/gist:11203573
Ubuntu 安装中文字体

环境 (Environment)

版本:Ubuntu 14.04 LTS 默认语言:English(United States)

安装 (Setup)

Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。

@Neil-UWA
Neil-UWA / sizeof.js
Created March 17, 2016 08:52
simple Sizeof
/*
String is primitive value, that is a finite ordered sequence of zero or more 16-bit unsigned integer
Each integer value in the sequence usually represents a single *16-bit* unit of UTF-16 text.
However, ECMAScript does not place any restrictions or requirements on the values except that they must be 16-bit unsigned integers
Number is primitive value, corresponding to a *double-precision* *64-bit* binary format IEEE 754 value
*/
function sizeof(data) {
if (typeof data === 'string') {
@Neil-UWA
Neil-UWA / palindrome.js
Last active February 29, 2016 05:52
Palindrome
````
//without using [].reverse()
function palindrome(string) {
var normalized = string.match(/\w*/g).filter(function(value){return value}).join('').toLowerCase();
var length = normalized.length;
for( var start = 0;; start < length/2; start ++) {
if(normalized[start] != normalized[length -1 -start]) return false;
}
return true;
}