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
{ | |
"name": "WebScraping", | |
"main": "scrap.js", | |
"dependencies": { | |
"cheerio": "~0.13.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
Ca nécessite à minima : | |
html5shiv : https://github.com/aFarkas/html5shiv | |
base64 : https://code.google.com/p/stringencoders/source/browse/trunk/javascript/base64.js?r=230 | |
JSON 2 : https://github.com/douglascrockford/JSON-js/blob/master/json2.js | |
Respond : https://github.com/scottjehl/Respond | |
Polyfills de toutes les méthodes de Array, Object, String, telles que (non exhaustif) : | |
- Object.keys https://github.com/MathRobin/object.keys | |
- Object.create https://github.com/MathRobin/object.create |
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
<!DOCTYPE html> | |
<html lang="fr" manifest="/manifeste.appcache"> | |
<head> | |
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--> | |
<meta charset="UTF-8"> | |
<!-- Meta SEO --> | |
<title>Web App</title> | |
<meta name="author" content="author"> | |
<meta name="description" content="Description"> | |
<!-- RWD --> |
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 | |
# Run from your project's root | |
# Run "npm install" or "npm update" before | |
# Requirement: jq (https://stedolan.github.io/jq/) | |
required () { | |
grep -R "from ['\"]${1}[\\/'\"]\|require(['\"]${1}[\\/'\"]" --exclude-dir=node_modules --include='*.js' > /dev/null | |
} |
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
// UPD: | |
// Now available as npm module! | |
// Check out https://github.com/RReverser/better-log for details. | |
console.log = (function (log, inspect) { | |
return function () { | |
return log.apply(this, Array.prototype.map.call(arguments, function (arg) { | |
return inspect(arg, { depth: 1, colors: true }); | |
})); | |
}; |
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
# Download Sublime Text 2 from http://www.sublimetext.com/2 | |
# If you aren't root, sudo su | |
tar -xvjf Sublime\ Text\ 2*.tar.bz2 | |
mv Sublime\ Text\ 2/ /opt/sublime-text-2/ | |
ln -s /opt/sublime-text-2 /usr/local/sublime-text-2 | |
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text | |
rm Sublime\ Text\ 2*.tar.bz2 | |
# Sublime Text 2 can now be run as normal user with command "sublime_text" |
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
function dedent(callSite, ...args) { | |
function format(str) { | |
let size = -1; | |
return str.replace(/\n(\s+)/g, (m, m1) => { | |
if (size < 0) | |
size = m1.replace(/\t/g, " ").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
(function( $ ) { | |
$.fn.simulateDragDrop = function(options) { | |
return this.each(function() { | |
new $.simulateDragDrop(this, options); | |
}); | |
}; | |
$.simulateDragDrop = function(elem, options) { | |
this.options = options; | |
this.simulateEvent(elem, options); | |
}; |
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
// ES6 tl;dr; for beginners | |
// 1. variables | |
// `const` & `let` are scoped at the block level | |
if(true) { | |
let foo = "bar" | |
} | |
foo // ReferenceError | |
OlderNewer