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 http = require("http"); | |
var cheerio = require("cheerio"); | |
/** | |
* Utility function that downloads a URL and invokes | |
* callback with the data. | |
*/ | |
function download(url, callback) { | |
http.get(url, function(res) { | |
var data = ""; |
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 request = require("request"); | |
var cheerio = require("cheerio"); | |
var jar = request.jar(); | |
var request = request.defaults({ | |
jar: jar, | |
followRedirect: true, | |
maxRedirects: 10 | |
}); |
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 request = require("request"); | |
var cheerio = require("cheerio"); | |
var jar = request.jar(); | |
var headers = { | |
"user-agent": "Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0" | |
}; | |
var options = { | |
jar: jar, |
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 provecss = require('provecss'); | |
var fs = require('fs'); | |
// read file | |
var input = fs.readFileSync('headers.css', 'utf8'); | |
var output = provecss(input, {path:'headers.css'}); | |
// write file | |
fs.writeFileSync('headers.out.css', output); |
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
/* ----------------------------------------------------------------- | |
HEADERS: layout | |
This is our base CSS file. | |
Should not be defined here form factor or skin | |
dependent styles. | |
----------------------------------------------------------------- */ | |
section[role="region"] > header:first-child { | |
position: relative; | |
z-index: 10; |
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
// Take control of your globals | |
//basic | |
(function () { | |
// your code here | |
})(); | |
// pass param in | |
(function ($) { | |
$(document).ready(function () { |
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.log(JSON.stringify(obj, null, 4)); |
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
# temp save git change | |
git stash | |
# list stashed items | |
git stash list | |
# get back | |
git stash pop | |
# get specify version back | |
git stash apply stash@{1} |
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
Prepare | |
edit ~/.hgrc like this: | |
[ui] | |
username=Name <your@email> | |
[extensions] | |
hgext.mq = | |
[diff] |
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
/** | |
* Main entry point. | |
* | |
* the DOM has been localized and the user sees it in their language. | |
* | |
* @class Main | |
*/ | |
(function() { | |
'use strict'; |