Skip to content

Instantly share code, notes, and snippets.

@blkpark
blkpark / address.rs
Last active April 27, 2016 05:37
rust tutorial
fn main() {
let s = Struct_example::new(0,0);
let b = 2;
let pt_s = &s as *const _;
let pt_b = &b as *const i32;
println!("{:?} {:?}", pt_s, pt_b); // 0x7fff52942808 0x7fff52942804
}
@blkpark
blkpark / better-nodejs-require-paths.md
Created December 13, 2015 18:26 — 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