Skip to content

Instantly share code, notes, and snippets.

View nbouliol's full-sized avatar
🏠
Working from home

Nicolas Bouliol nbouliol

🏠
Working from home
View GitHub Profile
function getString(from, to) {
let f = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(from)
let t = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(to)
return `${f} à ${t}`
}
/**
* Generes les horaires à partir d'une heure de début de journée
*
* @param {number} start_hour L'heure de début. ex : 9
function getString(from, to) {
let f = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(from)
let t = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(to)
return `${f} à ${t}`
}
/**
* Generes les horaires à partir d'une heure de début de journée
*
* @param {number} start_hour L'heure de début. ex : 9
function getString(from, to) {
let f = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(from)
let t = new Intl.DateTimeFormat('fr', {hour:'numeric',minute:'numeric'}).format(to)
return `${f} à ${t}`
}
/**
* Generes les horaires à partir d'une heure de début de journée
*
* @param {number} start_hour L'heure de début. ex : 9
@nbouliol
nbouliol / script.js
Created June 11, 2020 11:50
Allow copy/paste on websites that disable it
var allow = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('paste', allow, true);
document.addEventListener('copy', allow, true);
@nbouliol
nbouliol / tasks.json
Created March 29, 2019 09:50
vscode task to check ts
{
"version": "2.0.0",
"tasks": [
{
"label": "TSCompileAll",
"type": "shell",
"command": "./node_modules/.bin/tsc --watch --noEmit --project .",
"problemMatcher": ["$tsc-watch"]
}
]
@nbouliol
nbouliol / .vimrc
Created June 11, 2018 19:32
vim cfg
syn on
set mouse=a
set showcmd
set cursorline
set number
color happy_hacking
" git clone https://github.com/YorickPeterse/happy_hacking.vim.git $HOME/.vim
open ~/Library/Preferences/com.apple.dock.plist
killall Dock
alias code='open $@ -a "Visual Studio Code"'
alias t=touch
alias m=mkdir
alias vzsh='vi $HOME/.zshrc'
alias szsh='source $HOME/.zshrc'
alias dm=docker-machine
alias dci='docker rmi -f $(docker images -qa)'
alias dcc='docker rm -f $(docker ps -aq)'
@nbouliol
nbouliol / facebook-delete-all-group-members.js
Last active September 15, 2017 14:43 — forked from sezgi/facebook-delete-all-group-members.js
Deletes all group members from a facebook group except yourself. Leaving the group after running this in the javascript console will delete the group. Tested on Chrome May 29, 2017. If your network is super slow, you might want to increase the timeout delay.
// removes your box from the page so you don't get removed from the group
$$('[data-name=GroupProfileGridItem]')[0].remove();
// member action dropdowns
const actions = $$('.adminActions');
// open all dropdowns so they're added to the DOM
for (var i = 0; i < actions.length; i++) {
$$('.adminActions button')[i] && $$('.adminActions button')[i].click();
}