Skip to content

Instantly share code, notes, and snippets.

View gucheen's full-sized avatar

Cheng Gu gucheen

View GitHub Profile
@gucheen
gucheen / stuns
Created July 3, 2016 15:20 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@gucheen
gucheen / run_cmd.js
Created February 25, 2016 11:36
run cmd in node.js
run_cmd('./aria2c', ['--enable-rpc', '--rpc-listen-all'], function (text) {
console.log(text);
});
return $q.defer().promise;
@gucheen
gucheen / nvm.sh
Last active February 16, 2016 05:32
use nvm in every shell
nvm alias default node
@gucheen
gucheen / MortredStaticServer.go
Last active December 22, 2015 02:11
MortredStaticServer
package main
import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"io/ioutil"
)
type Settings map[string]string
@gucheen
gucheen / animate-box-shadow.css
Created December 3, 2015 08:20
animate "box-shadow" with silky smooth performance
.box {
position: relative;
display: inline-block;
width: 100px;
height: 100px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
border-radius: 5px;
-webkit-transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
@gucheen
gucheen / parseLodash.js
Created August 25, 2015 05:51
Safe JSON.parse with lodash.js
function parseLodash(str){
return _.attempt(JSON.parse.bind(null, str));
}
@gucheen
gucheen / isDescendant.js
Created June 17, 2015 09:40
isDescendant.js
function isDescendant(parent, child) {
var node = child.parentNode;
while (node != null) {
if (node == parent) {
return true;
}
node = node.parentNode;
}
return false;
}
@gucheen
gucheen / Animated Weather Icons.markdown
Created June 17, 2015 03:37
Animated Weather Icons
.ui-select-bootstrap.ng-invalid span.btn.ui-select-toggle {
border-color: #D44950 !important;
}