View javascript-functions-contexts.js
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
'use strict' // attention ces considérations ne sont valides qu'en utilisant le mode strict | |
var globale = 'globale' | |
var methode3 = () => { | |
if (!this || !this.attrLocal) { | |
console.log(' > methode3() NE partage PAS le contexte de Classe1') | |
} | |
if (this && this.attrLocal) { | |
console.log(' > methode3() partage le contexte de Classe1') |
View irc-bot-bypass-encoding.js
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/local/bin/node | |
var irc = require('irc') | |
var me = 'me' | |
var channel = '#chann' | |
var dest = 'dest' | |
var data = '\x24\xb1\x04\x08' // 0x804b120 | |
var client = new irc.Client('irc.root-me.org', me, { |
View node-postgres-benchmark.js
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 { Pool } = require('pg') | |
const debug = require('debug')('a') | |
const defaultParams = { | |
database: 'postgres', | |
user: 'myuser', | |
password: 'mysecretpassword', | |
host: 'localhost', | |
port: 5432 | |
} |
View cssToInlineStyle.js
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 cssParser = require('css') | |
const { JSDOM } = require('jsdom') | |
function cssToInlineStyle (inputHtml) { | |
let style = inputHtml.match(/(?:<style[^>]*>)((?:[\r\n]|.)*?)(?:<\/style>)/) | |
const html = inputHtml.replace(/<style[^>]*>(([\r\n]|.)*?)<\/style>/, '') | |
if (!style) { | |
throw new Error('error while parsing') | |
} |
View vuejs-if-else-example.html
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"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Titre de la page</title> | |
<style> | |
nav ul li { | |
display: inline-block; | |
border: 1px solid red; | |
width: 200px; |
View vuejs-if-else-filter-example.html
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"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Titre de la page</title> | |
<style> | |
nav ul li { | |
display: inline-block; | |
border: 1px solid red; | |
width: 200px; |
View accueil.component.js
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
/* globals Vue */ | |
;(function () { | |
'use strict' | |
const template = ` | |
<section id="accueil"> | |
<h1>Titre de ma page d'accueil</h1> | |
<p>Mon super texte</p> | |
</section> | |
` |
View vuejs-v-for-example.html
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"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Titre de la page</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div id="app"> | |
<nav> |
View guacamole-add-connection.js
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 parseString = require('xml2js').parseString | |
var builder = new (require('xml2js').Builder)() | |
var fs = require('fs') | |
var argv = require('optimist') | |
.usage('Usage: $0 --input <input.xml> --name <machine-name>') | |
.options('hostname', {default: '@host'}) | |
.options('port', {default: '3389'}) | |
.options('serverLayout', {default: 'fr-fr-azerty'}) | |
.options('colorDepth', {default: '16'}) | |
.demand('name') |
View xxxxxaaaaaa.js
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 Axios = require('axios') | |
exports.startToEndProcessQuery = function (req, res) { | |
return Axios.get('/explore.articlesearch.v1/favouriteSearch?edismax=true&storeId=00016&language=fr-FR&country=FR&query=' + req.params.str + '&rows=1000&page=1&profile=orSearch&null&__t=1541347156148') | |
.then(function (response) { | |
let stringIds = '' | |
let limits = response.data.regularResults.resultIds.length > 50 ? 50 : response.data.regularResults.resultIds.length | |
for (let i = 0; i < limits; i++) { | |
stringIds += response.data.regularResults.resultIds[i] + '&ids=' | |
} |
OlderNewer