This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// look at this glorious shit!! look what you can do with with!! | |
const someObject = { | |
foo: 'bar', | |
baz: 1, | |
asdf: ['quux'], | |
} | |
with (someObject) { | |
console.log(foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var codes = | |
[ 'function funny(p) {\n' + | |
' return [p, s];\n' + | |
'}\n', | |
'var funny = function (p) {\n' + | |
' return [p, s];\n' + | |
'}\n', | |
'var funny = function wry(p) {\n' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A bunch of the stuff above relies on this, especially the aliases. | |
[user] | |
# you probably want to change this bit. | |
name = isaacs | |
email = i@izs.me | |
signingkey = 0x6C481CF6 | |
[alias] | |
ci = commit | |
st = status | |
br = branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 3f37a214961b014f5d48703c2e5f62dd9601bf4d Mon Sep 17 00:00:00 2001 | |
From: isaacs <i@izs.me> | |
Date: Fri, 1 Apr 2011 17:46:18 -0700 | |
Subject: [PATCH 1/5] docs for chown/chmod | |
--- | |
doc/api/fs.markdown | 45 +++++++++++++++++++++++++++++++++++++++++++++ | |
1 files changed, 45 insertions(+), 0 deletions(-) | |
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**package | |
* { "name": "npm-test-single-file" | |
* , "main": "index.js" | |
* , "version": "1.2.3" | |
* , "description":"No package.json in sight!" | |
* , "dependencies": { "minimatch": "*" } | |
* } | |
**/ | |
module.exports = "I'm just a lonely index, naked as the day I was born." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.error('register extension', process.version) | |
const { writeFileSync, readFileSync } = require('fs') | |
const transpile = exports.transpile = file => { | |
const src = readFileSync(file, 'utf8') | |
const tx = `console.log(${JSON.stringify(src)})` | |
writeFileSync(file + '.cjs', tx) | |
} | |
require.extensions['.foo'] = (module, file) => { | |
transpile(file) | |
module.filename = file + '.cjs' |
NewerOlder