Skip to content

Instantly share code, notes, and snippets.

View kewang's full-sized avatar
🎯
Focusing

Kewang kewang

🎯
Focusing
View GitHub Profile
@kewang
kewang / index.jade
Created July 10, 2014 15:43
this is test gist
extends layout
block content
.container
.row
#tables.col-md-2(ng-controller="TableCtrl")
h2
| TABLES
button.btn.btn-default(type="button", ng-click="createTable()")
span.glyphicon.glyphicon-plus
@kewang
kewang / complex-json
Created August 27, 2014 06:24
complex-json
public class Layout {
private String layoutID;
private String title;
private ArrayList<Component> components;
public static class Component {
private String type;
private ComponentEntity entity;
public static abstract class ComponentEntity {
@kewang
kewang / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
RequestObject rq =new RequestObject();//Request物件
string requestJson = JsonConvert.SerializeObject(rq);
string responseJson = ""; //回傳結果
HttpWebRequest ProposalRq = (HttpWebRequest)HttpWebRequest.Create(Url);
Map<String, Integer> sources = new HashMap<String, Integer>();
Map<Integer, ArrayList<String>> results = new HashMap<Integer, ArrayList<String>>();
sources.put("a", 1);
sources.put("b", 3);
sources.put("c", 5);
sources.put("d", 1);
sources.put("e", 3);
sources.put("f", 7);
sources.put("g", 7);
@kewang
kewang / rand1.c
Last active December 19, 2015 05:21
Math.random() at V8 engine from https://blog.gslin.org/archives/2015/12/18/6202/
// MWC1616 (multiply with carry, combining two 16-bit parts)
#include <stdio.h>
#include <inttypes.h>
uint32_t state0 = 1;
uint32_t state1 = 2;
uint32_t mwc1616();
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kewang
kewang / pom.xml
Created January 16, 2014 15:16
maven for android
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>padfone-launcher-switcher</groupId>
<artifactId>padfone-launcher-switcher</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@kewang
kewang / Passport.js
Created March 28, 2016 07:59
Passport 的多帳號做法 (node.js)
var bcrypt = require('bcryptjs');
/**
* Hash a passport password.
*
* @param {Object} password
* @param {Function} next
*/
function hashPassword (passport, next) {
if (passport.password) {
@kewang
kewang / aar.gradle
Last active April 4, 2016 05:38
Import Android library
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile(name: 'map-controller', ext: 'aar')
}