Skip to content

Instantly share code, notes, and snippets.

@friskfly
friskfly / multiple-url-paths.lua
Created February 18, 2016 05:31 — forked from anonymous/multiple-url-paths.lua
Benchmark multiple url paths with wrk
-- Resource: https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua
-- Initialize the pseudo random number generator
-- Resource: http://lua-users.org/wiki/MathLibraryTutorial
math.randomseed(os.time())
math.random(); math.random(); math.random()
-- Shuffle array
-- Returns a randomly shuffled array
function shuffle(paths)
@friskfly
friskfly / better-nodejs-require-paths.md
Last active September 19, 2015 08:02 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@friskfly
friskfly / dabblet.html
Last active December 10, 2015 03:58 — forked from rocketxujia/dabblet.html
竖排
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<style>
h1 {
width: 1em;
font-size: 40px;