Skip to content

Instantly share code, notes, and snippets.

Pierre CLÉMENT pierrecle

Block or report user

Report or block pierrecle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View alphabeticAnagrams.js
class Anagram {
constructor(word) {
this.word = word;
}
get uniqChars() {
var chars = this.word.split('').filter((letter, index) => this.word.indexOf(letter,index+1) === -1);
chars.sort();
return chars;
}
View Snail.js
class Snail {
static rotate(array) {
return array[0].map((_, lineIndex) => {
var lineLength = array[0].length;
return array.map((__, eltIndex) => {
return array[eltIndex][lineLength - lineIndex - 1];
});
});
}
@pierrecle
pierrecle / knightVsKing.js
Created Mar 9, 2016
My implementation for the dojo knight vs king
View knightVsKing.js
// Sorry, I lost the tests..
'use strict';
class Fight {
constructor(knightPosition, kingPosition) {
this.knightPosition = Fight.cleanPosition(knightPosition);
this.kingPosition = Fight.cleanPosition(kingPosition);
}
static cleanPosition(rawPosition) {
View Installer Xpenology sur un NAS ReadNas.md

Installer Xpenology sur un NAS ReadNas

Préparation

Le NAS utilisé ici est un NAS avec processeur Intel 64 bits, un Netgear ReadyNAS Ultra 2 (RNDU2000).

Liste de courses :

  • une clé USB pour mettre XPEnoboot

Clé USB

View Installer Debian sur un NAS Netgear.md
@pierrecle
pierrecle / pre-commit
Last active Oct 13, 2015
Hook to prevent accidental commit on master branch
View pre-commit
#!/bin/bash
# Stops accidental commits to master
# Inspired from https://gist.github.com/stefansundin/9059706
# To download: curl -fL -o ".git/hooks/pre-commit" "https://gist.github.com/pierrecle/d04230da2e978af7c4fb/raw/pre-commit" && chmod +x .git/hooks/pre-commit
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ "$BRANCH" == "master" ]]; then
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
echo "If so, commit with -n to bypass this pre-commit hook."
@pierrecle
pierrecle / tasks.json
Created Oct 7, 2015
Visual Studio Code problem matcher for Karma tests on Typescript files with sourcemaps.
View tasks.json
{
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": [
"--no-color"
],
"tasks": [
{
"taskName": "test",
You can’t perform that action at this time.