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 / 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 / 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 / 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 / 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 / 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");
font-family: Helvetica, Tahoma, Arial, STXihei, "华文细黑", "Microsoft YaHei", "微软雅黑", SimSun, "宋体", Heiti, "黑体", sans-serif;
@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
@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);
Bing Spatial Data Services, 2.0
Id| GeocodeRequest/Culture| GeocodeRequest/Query| GeocodeRequest/Address/AddressLine| GeocodeRequest/Address/AdminDistrict| GeocodeRequest/Address/CountryRegion| GeocodeRequest/Address/AdminDistrict2| GeocodeRequest/Address/FormattedAddress| GeocodeRequest/Address/Locality| GeocodeRequest/Address/PostalCode| GeocodeRequest/Address/PostalTown| GeocodeRequest/ConfidenceFilter/MinimumConfidence|ReverseGeocodeRequest/IncludeEntityTypes| ReverseGeocodeRequest/Location/Latitude| ReverseGeocodeRequest/Location/Longitude| GeocodeResponse/Address/AddressLine| GeocodeResponse/Address/AdminDistrict| GeocodeResponse/Address/CountryRegion| GeocodeResponse/Address/AdminDistrict2| GeocodeResponse/Address/FormattedAddress| GeocodeResponse/Address/Locality| GeocodeResponse/Address/PostalCode| GeocodeResponse/Address/PostalTown| GeocodeResponse/Address/Neighborhood| GeocodeResponse/Address/Landmark| GeocodeResponse/Confidence| GeocodeResponse/Name| GeocodeResponse/EntityType| GeocodeResponse/Mat
@rankun203
rankun203 / verifyEmail.html
Last active September 30, 2016 07:09
A HTML page does the email address verification!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
.center {
text-align: center;
margin: 0 auto;