Skip to content

Instantly share code, notes, and snippets.

{
"name": "WebScraping",
"main": "scrap.js",
"dependencies": {
"cheerio": "~0.13.1"
}
}
@MathRobin
MathRobin / Dependencies
Created December 12, 2014 15:05
Angular sous IE7
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
@magsout
magsout / head.html
Last active June 19, 2018 13:07
Minimum Web App <head> configuration
<!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 -->
@naholyr
naholyr / npm-check-used.sh
Created April 12, 2016 08:40
Check if your npm dependencies are actually used
#!/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
}
@RReverser
RReverser / better-console-log.js
Last active May 9, 2019 21:07
Better console.log in Node
// 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 });
}));
};
@Kerrick
Kerrick / gist:2716568
Created May 17, 2012 05:08
HOWTO install Sublime Text 2 in Debian Squeeze
# 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"
@zenparsing
zenparsing / dedent-template.js
Last active April 25, 2023 22:16
Dedenting Template Strings
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;
@rcorreia
rcorreia / drag_and_drop_helper.js
Last active August 11, 2023 06:41
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
@bloodyowl
bloodyowl / gist:5d8adcf50e890ebafb95
Last active September 30, 2023 16:49
ES6 tl;dr; for beginners
// ES6 tl;dr; for beginners
// 1. variables
// `const` & `let` are scoped at the block level
if(true) {
let foo = "bar"
}
foo // ReferenceError