Skip to content

Instantly share code, notes, and snippets.

View t8g's full-sized avatar

Thomas Moyse t8g

  • ByteClub
  • Nantes
View GitHub Profile
const path = require('path');
module.exports = {
entry: "./app",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js"
},
devServer: {
@t8g
t8g / q1.2.js
Last active January 16, 2017 12:26
[1, 2, 3, '4'].map(function (x) {
if (typeof x === 'number') return x + 1;
});
[
{
"id": 1,
"title": "La caverne du dragon de jade",
"chapters": [
{
"id": 1,
"story": "Vous êtes dans une salle plein de pièges. Une porte en face. Lancez un dé pour savoir si vous êtes chanceux.",
"moves": [
{
Au bout de 100ms
source1: 0, source2: null, source: null
Au bout de 150ms
source1: 0, source2: 0, source: 0,0
Au bout de 200ms
source1: 1, source2: 0, source: 1,0
Au bout de 300ms (source2 et source1 sont théo au même moment, mais en fait source1 est déclenché avant en rx5 et après en <5)
@t8g
t8g / introduction webpack.md
Last active April 11, 2017 18:38
Webpack : introduction

Webpack

Installation

  • > mkdir projet && cd projet
  • > npm init
  • > npm i webpack --save-dev

Préparation

@t8g
t8g / gist:a6567cc839d77041c1ea
Created November 15, 2014 15:08
dockeriser un proxy
Exposé du problème :
* private1.com et private2.com ne sont accessibles que via vpn
* je ne veux pas connecter directement mon pc au vpn
Idée (qui marche avec un virtualbox) :
1. Créer un dock avec
* une connexion au vpn
@t8g
t8g / pl.js
Last active January 1, 2016 19:59
Print to pdf with header (lmtm)
#!/usr/bin/env node
// INSTALLATION :
// install phantomjs && node
// > (sudo) npm install -g marked
// > (sudo) npm install -g tmp
// Copy this script in a bin directory (/usr/local/bin) as "md2pdf"
// > (sudo) chmod a+x /usr/local/bin/md2pdf
// USAGE :
@t8g
t8g / package.json
Created December 17, 2013 08:29
Formation Angular : fake.js
{
"name": "fake",
"version": "0.0.0",
"license": "BSD-2-Clause",
"dependencies": {
"lodash": "~2.4.1",
"express": "~3.4.7",
"node-uuid": "~1.4.1"
}
}
@t8g
t8g / index.html
Last active December 29, 2015 18:08
A very small (and useless) todo app
<html lang="fr">
<head>
<meta charset="utf-8">
</head>
<body ng-app ng-init="users = []">
<ul>
<li ng-repeat="item in users">{{ item }} <a href="" ng-click="users.splice($index, 1)">x</a></li>
</ul>
<input ng-model="item" placeholder="todo"><button ng-click="users.push(item);item='';">Add</button>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script>
@t8g
t8g / index.html
Last active December 29, 2015 04:38 — forked from lionelB/index.html
<!doctype html>
<html ng-app="ui">
<head>
<meta charset="UTF-8">
<title>Angular numeric Stepper</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, height=device-height, maximum-scale=1" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap-theme.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.css" />