- foo
- bar
- baz
- qux
- quux
- quuz
- corge
- grault
- garply
- grault
- corge
- quuz
- quux
- qux
- baz
- bar
- waldo
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
// ==UserScript== | |
// @name MEGAUPLOAD direct downloader | |
// @namespace http://hail2u.net/ | |
// @include http://www.megaupload.com/?d=* | |
// ==/UserScript== | |
window.location.href = window.location.href.replace(/\/\?d=/, "/mgr_dl.php?d="); |
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
// node index.js --count=5 --format=html --type=paragraph | |
// --count: 1-32 (default; 5) | |
// --format: html, txt (default) | |
// --type: list, paragraph (default) | |
import fs from "fs"; | |
import minimist from "minimist"; | |
const select = (data) => data[Math.floor(Math.random() * data.length)]; |
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
// $ node inline-css.js <path-to-html-file> | |
import fs from "fs/promises"; | |
import jsdom from "jsdom"; | |
import postcss from "postcss"; | |
const { JSDOM } = jsdom; | |
const hasNode = (document, selector) => { | |
if (selector.includes(":")) { |
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
const to8Chunks = (previous, current, index) => { | |
const remainder = index % 8; | |
if (!previous[remainder]) { | |
previous.push([]); | |
} | |
previous[remainder].push(current); | |
return previous; | |
}; |
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
# show Git branch name with some informations | |
# normal: ~/git/foo (master) | |
# something to commit: ~/git/foo (master*) | |
# not pushed to origin: ~/git/foo (master!) | |
# something to commit and not pushed to origin: ~/git/foo (master*!) | |
# Git: get branch status | |
function git_get_branch_status { | |
local STATUS=`git status 2> /dev/null | tail -n1` | |
[[ ${STATUS} != "nothing to commit (working directory clean)" ]] && echo -ne "*" |
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
// list unused custom properties | |
// $ node list-unused-custom-properties.js <FILENAME> | |
const fs = require("fs"); | |
const postcss = require("postcss"); | |
const css = postcss.parse(fs.readFileSync(process.argv[2], "utf8")); | |
const customProperties = {}; | |
css.walkDecls(decl => { | |
if (decl.prop.startsWith("--")) { |
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
{} |
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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var fd = process.stdin.fd; | |
var length = fs.fstatSync(fd).size; | |
var input = fs.readSync(fd, length)[0]; | |
var escape = escapeHTML(input); | |
console.log(escape); |
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
$ node include-helper.js test,tmpl | |
<p>apple is sweet and red.</p> | |
<p>orange is sweet and orange.</p> | |
<p>grape is sweet and purple.</p> | |