Skip to content

Instantly share code, notes, and snippets.

Ping <--> Pong

代码家 daimajia

Ping <--> Pong
View GitHub Profile
View linux上用strongswan搭建ikev2协议

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2




apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
View Node
var start =;
var sum = 0;
for(var i = 0; i <= 1000000000; ++i){
sum += i;
var end =;
var span = end - start;
console.log(span / 1000 + " seconds");
View Binary Tree Zigzag Level Order Traversal -- LeetCode
public class Solution {
private Map<Integer, ArrayList<Integer>> maps = new TreeMap<Integer, ArrayList<Integer>>();
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {
zigzag(root, 0);
return new ArrayList<List<Integer>>(maps.values());
public void zigzag(TreeNode node, int level){
daimajia / appjs-express-jade-example.js
Last active Dec 18, 2015
nodejs / appjs / express / jade example
View appjs-express-jade-example.js
author: daimajia
name: appjs Express example
any question feel free to email me :)
View useful-css-snippets.css
*reset css
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.



Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should be using: