Skip to content

Instantly share code, notes, and snippets.

View w1shen's full-sized avatar

Walter Shen w1shen

  • LinkedIn
  • San Francisco
View GitHub Profile
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<article>
<h2>Backend Engineer</h2>
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<article>
<h2>Backend Engineer</h2>
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<article>
<h2>Backend Engineer</h2>
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<article>
<h2>Backend Engineer</h2>
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<div>
<h2>Backend Engineer</h2>
<!doctype html>
<html>
<head>
<title>The HTML5 Outline</title>
<meta charset="utf-8">
</head>
<body>
<h1>I WANT YOU!</h1>
<div>
<h2>Backend Engineer</h2>
public class ConcurrentStack<E> {
AtomicReference<Node<E>> head = new AtomicReference<Node<E>>();
public void push(E item) {
Node<E> newHead = new Node<E>(item);
Node<E> oldHead;
do {
oldHead = head.get();
newHead.next = oldHead;
@w1shen
w1shen / AtomicTest.java
Created April 17, 2013 05:45
atomic write: 25377ms, synchronized write: 56757ms, atomic read: 639ms, synchronized read: 56181ms, volatile read: 43ms, normal read: 640ms,
package pig.pigtest;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.Test;
public class AtomicTest {
private AtomicLong v1 = new AtomicLong(0);
private long v2 = 0;
@w1shen
w1shen / learn-async.js
Last active December 16, 2015 07:49
learn async.js
var assert = require("assert");
var async = require("async");
var fs = require("fs");
var files = ["node_modules/async/LICENSE", "node_modules/async/package.json"];
async.map(files, fs.stat, function(err, results) {
console.log("map: " + JSON.stringify(results));
});
@w1shen
w1shen / apply-syntaxhighlighter-dynamic-brush2.html
Last active December 14, 2015 18:19
Include the following code in front of the end html tag of your template file.
<!-- Syntax Highlighter Additions START -->
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/>
<script language='javascript' type='text/javascript'>
//<![CDATA[
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.config.bloggerMode = true;
function alexgorbatchev() {
var args = arguments;