Skip to content

Instantly share code, notes, and snippets.

// my webpack.config.js
{
test: /\.s?css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
minimize: true,
import path from 'path';
import webpack, { DefinePlugin, BannerPlugin, HotModuleReplacementPlugin, NoErrorsPlugin } from 'webpack';
import merge from 'lodash/object/merge';
const DEBUG = !process.argv.includes('--release');
const GLOBALS = {
'process.env.NODE_ENV': DEBUG ? '"development"' : '"production"',
__DEV__: DEBUG
};
import path from 'path';
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import appConfig from '../tools/config';
const app = express();
const port = 3000;
const compiler = webpack(appConfig);
var cloneWithProps = React.addons.cloneWithProps;
var SmartSortable = React.createClass({
getDefaultProps: function() {
return {component: "ul", childComponent: "li"};
},
render: function() {
var props = jQuery.extend({}, this.props);

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

var JP = JP || {};
JP.Func = JP.Func || {};
JP.App = (function() {
//fires only when document.ready
var ready = $(function() {
console.log("ready");
JP.Func.collapseFooter.init();
JP.Func.slideoutMenu.init();
JP.Func.responsiveTable.init();