Skip to content

Instantly share code, notes, and snippets.

View rankun203's full-sized avatar
🔨
building things

Kun R rankun203

🔨
building things
View GitHub Profile
@rankun203
rankun203 / a-server-side-geocoding.js
Last active April 30, 2016 03:10
Convert address to geocode
// HTTP request
const http = require('https');
const api = 'https://maps.googleapis.com/maps/api/geocode/json?address=%s',
address = '5101 ASHLEY PHOSPHATE RD STE 145 N CHARLESTON SC 29418-2843',
url = api.replace('%s', address);
http.get(url, res => {
res.on('data', d => {
console.log('' + d);
@rankun203
rankun203 / curl-github-tj-n.sh
Last active April 30, 2016 02:13
A simple way to install latest version of Node.js
curl -L http://git.io/n-install | bash
# then CREATE a NEW terminal session. run node
font-family: Helvetica, Tahoma, Arial, STXihei, "华文细黑", "Microsoft YaHei", "微软雅黑", SimSun, "宋体", Heiti, "黑体", sans-serif;
@rankun203
rankun203 / functions.php
Last active March 24, 2016 08:53
Wordpress, override any version number regardless parent or child.
<?php
//***** Configure the DEFAULT Style
function my_wp_default_styles($styles)
{
// use release date for version
$styles->default_version = filemtime( get_template_directory() );
}
add_action("wp_default_styles", "my_wp_default_styles");
@rankun203
rankun203 / ydGeetest.js
Last active April 15, 2016 04:27
Geetest 极验 for Angular Directive by youdar.net
/**
* Created on 3/1/16.
* https://docs.angularjs.org/guide/directive
* @author rankun203
*/
App
.directive('ydGeetest', function () {
return {
restrict : 'AE',
@rankun203
rankun203 / db_index.js
Created March 1, 2016 08:59
Sequelize and Redis setup
/**
* Created on 1/6/16.
* @author rankun203
*/
'use strict';
module.exports.sequelize = require('./sequelize');
module.exports.redis = require('./redis');
@rankun203
rankun203 / omit-empty.js
Created March 1, 2016 08:58
Omit empty properties
/**
* Created on 2/9/16.
* @author rankun203
*/
'use strict';
const _ = require('lodash');
/**
* Omit property when empty value
*
@rankun203
rankun203 / generator.js
Last active March 1, 2016 08:57
Test Promise + custom Runner
/**
* Created on 3/1/16.
* @author rankun203
*/
'use strict';
let Promise = require('bluebird');
// Promise + runner test
@rankun203
rankun203 / genFileKey.js
Created February 13, 2016 10:36
function genFileKey()
/**
* 根据文件名生成文件的 key
* @param fileName
* @returns {string}
*/
function genFileKey(fileName) {
var fileKey = '';
// 将文件名中的有效字符提取出来作为文件 key
var realFileName = fileName.match(/[\w|\.]/g).join('');
@rankun203
rankun203 / Angular Material Basic App.markdown
Created August 4, 2015 11:23
Angular Material Basic App