Skip to content

Instantly share code, notes, and snippets.

@pinguxx
pinguxx / layout.jade
Created November 30, 2011 21:32
Jade basic layout
!!! 5
//if lt IE 7
| <html class="no-js ie6 oldie" lang="en">
//if IE 7
| <html class="no-js ie7 oldie" lang="en">
//if IE 8
| <html class="no-js ie8 oldie" lang="en">
//if gte IE 9
| <html class="no-js" lang="en">
head
@pinguxx
pinguxx / install_node_linux
Created December 6, 2011 19:54
install node in linux
tar -zxf node-v0.6.5.tar.gz
cd node-v0.6.5
./configure
make
sudo make install
export PATH=$PATH:/opt/node/bin
@pinguxx
pinguxx / first_node
Created December 6, 2011 19:57
First node
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
@pinguxx
pinguxx / LICENSE.txt
Created December 8, 2011 23:43 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@pinguxx
pinguxx / file1.js
Created December 21, 2011 05:25
express example
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@pinguxx
pinguxx / index.jade
Created February 2, 2012 17:53
jade html5 example, complementary for layout.jade
#header-container
header.wrapper.clearfix
h1.title
#main-container
#main.wrapper.clearfix
#footer-container
footer.wrapper
render`
<table class="table table-striped table-bordered table-sm">
<thead>
<tr><th>Label</th><th>Value</th></tr>
</thead>
<tbody>
${ary.map(obj => wire(obj)`<tr><td>${obj.label}</td><td>${obj.value}</td></tr>`)}
</tbody>
</table>
`;
function display() {
render`
<table class="table table-striped table-bordered table-sm">
<thead>
<tr><th>Label</th><th>Value</th></tr>
</thead>
<tbody>
${ary.map(obj => wire(obj) `<tr><td>${obj.label}</td><td>${obj.value}</td></tr>`)}
</tbody>
</table>
function display() {
render`
<table class="table table-striped table-bordered table-sm">
<thead>
<tr>
<th><a onclick="${sort}" data-target="label" href="#">Label</a></th>
<th><a onclick="${sort}" data-target="value" href="#">Value</a></th>
</tr>
</thead>
<tbody>
function sort(e) {
console.log(e, e.target, this);
////MouseEvent,HTMLAnchorElement,HTMLAnchorElement
}