Skip to content

Instantly share code, notes, and snippets.

View jy95's full-sized avatar

Jacques Yakoub jy95

  • Brussels, Belgium
View GitHub Profile
@jy95
jy95 / *.java
Created November 8, 2017 18:51
TestHashCodes
public void TestHashCodes() {
MapInterface<Integer> map = new HashMap<Integer>();
// je génère des strings à la volée
for (int i = 0 ; i < 10 ; i++){
String txt = UUID.randomUUID().toString();
int hashcode = map.hashCode(txt);
// le hashcode doit être positif
assertTrue(hashcode >= 0);
// avec ce hashcode , on peut en déduire txt + char
@jy95
jy95 / episodeName.js
Created September 7, 2017 11:47
Example of test
const { expect } = require("chai");
const parse = require("../index").parse;
describe("Parsing episode name", () => {
it("should detect regular episode name correctly", () => {
const releaseName = "Marvel's.Agents.of.S.H.I.E.L.D.S02E01.Shadows.1080p.WEB-DL.DD5.1";
expect(parse(releaseName)).to.deep.include({ episodeName: "Shadows" });
});
@jy95
jy95 / npm-debug.log
Created August 27, 2017 22:04
my issue
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\Jacques\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'i',
npm verb cli 'jy95/torrent-files-library',
npm verb cli '--save',
npm verb cli '--verbose' ]
npm info using npm@5.3.0
npm info using node@v6.10.3
npm verb npm-session 6f4481895b1ccd44
@jy95
jy95 / npm-debug.log
Last active August 27, 2017 21:22
My issue log
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\Jacques\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli 'jy95/torrent-files-library',
npm verb cli '--verbose',
npm verb cli '-P' ]
npm info using npm@5.3.0
npm info using node@v6.10.3
npm verb npm-session a3eda87739cd65e7
@jy95
jy95 / sample.tex
Created August 9, 2017 18:59
Quelques trucs bien utiles
% un exemple pour insérer une figure, en essayant de garder le même ratio longueur/largeur selon ta page
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{illustrations/ComparaisonBloquantOuNon.png}
\caption{Bloquant/non-bloquant : téléchargement de deux fichiers}
\end{figure}
% une manière d'inclure les morceaux que tu veux de ton code, aide énornement à pas recopier :)
% en incluant bien sur un nom à ta figure et le fichier dans lequel il faut piocher
\lstinputlisting[linerange={44-50,54-56,66-72,78-114},caption=Implémentation typique d'un générateur]{sample_source_code/implementationApi/searchUsersDb.js}
@jy95
jy95 / main.tex
Created August 2, 2017 21:06
startup main.tex
% !TeX spellcheck = fr_FR
%
\documentclass[a4paper,12pt]{report}
\setcounter{secnumdepth}{4} % seting level of numbering (default for "report" is 3)
\usepackage{pdfpages} % use pdf for page title
% handle french language
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{color}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
% RAML langauge : listings language close to YAML
\newcommand\YAMLcolonstyle{\color{red}\mdseries}
\newcommand\YAMLkeystyle{\color{black}\bfseries}
\newcommand\YAMLvaluestyle{\color{blue}\mdseries}
@jy95
jy95 / webpack.config.js
Last active May 9, 2017 21:28
WORKING webpack.config.js : need to fix plugins
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const postcssPlugins = [
require('postcss-cssnext')(),
require('postcss-modules-values')
];
const scssLoader = [
@jy95
jy95 / package.json
Last active May 8, 2017 21:36
package.json
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --env=dev --progress --watch --content-base src/app"
},
"keywords": [],
@jy95
jy95 / nodeJsListings.tex
Last active May 30, 2017 08:04
Listings : Node.js code block
% Node.js code block
\usepackage{listings}
\usepackage{color}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\lstdefinelanguage{Node}{
keywords={do, if, in, for, let, new, try, var, case, else, enum, eval, null, this, true, void, with, await, break, catch, class, const, false, super, throw, while, yield, delete, export, import, public, return, static, switch, typeof, default, extends, finally, package, private, continue, debugger, function, arguments, interface, protected, implements, instanceof
},
morecomment=[l]{//},