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') |
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 | |
# WARNING ! THIS WAS WRITTEN A LONG TIME AGO (2018), IT MAY NOT BE RELEVANT ANYMORE | |
sudo apt-get install vnc4server ubuntu-desktop | |
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal |
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') |
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, { |
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 | |
} |
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 GoogleAuth = require('google-auth-library') | |
const OAuth2Client = GoogleAuth.OAuth2Client | |
const google = require('googleapis') | |
const clientId = '<YOUR_CLIENT_ID>' | |
const clientSecret = '<YOUR_CLIENT_SECRET>' | |
const redirectUri = '<Your URI Callback>' | |
const oauth2Client = new OAuth2Client(clientId, clientSecret, redirectUri) | |
// your oauth method, see documentation |
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') | |
} |
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; |
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; |
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> | |
` |
OlderNewer