Skip to content

Instantly share code, notes, and snippets.

View CMarzin's full-sized avatar
💭
Working around

Corentin Marzin CMarzin

💭
Working around
View GitHub Profile
function paginate (array, page_size, page_number) {
--page_number; // because pages logically start with 1, but technically with 0
return array.slice(page_number * page_size, (page_number + 1) * page_size);
}
@CMarzin
CMarzin / cloudSettings
Created January 23, 2019 14:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-23T14:08:52.032Z","extensionVersion":"v3.2.4"}
ZSH_THEME="powerlevel9k/powerlevel9k"
##########
# CONFIG POWERLEVEL
##########
POWERLEVEL9K_MODE='awesome-patched'
POWERLEVEL9K_VCS_GIT_GITHUB_ICON='\uE1AA'
@CMarzin
CMarzin / tAndC.html
Last active August 30, 2017 10:53
Regex for terms and conditions
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>regex terms and conditions</title>
</head>
<body></body>
<script>
var regex = /.*./g;
@CMarzin
CMarzin / scritp-git.sh
Last active January 9, 2018 10:09
Clone your own repo to anywhere you want in 2 command
#!/bin/bash
URL=$(curl -s 'https://api.github.com/user/repos?sort=pushedaccess_token=YOUR_PERSONNAL_GITHUB_TOKEN' | jq '.[] | .ssh_url' );
URL=${URL[@]//\"/};
clone(){
echo "Git clone: '$@'"
git clone $@
REPO=$@
temp=$(echo "$REPO" | grep -Po '(?<=\/)(.*?)(?=\.)')
echo "Now you can do :"
@CMarzin
CMarzin / terminalLove.json
Last active August 15, 2017 17:11
Terminal alias and personal configuration
{
"monitoring": "https://github.com/aksakalli/gtop",
"zsh": "http://www.zsh.org",
"oh-my-zsh": "https://github.com/robbyrussell/oh-my-zsh",
"oh-my-zsh cheatsheet": "https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet",
"path visual studio code in .zshrc": "export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"",
"alias":
{
"please": "sudo",
"monitor": "LANG=en_US.utf8 TERM=xterm-256color gtop",
@CMarzin
CMarzin / vsCodeExtension.json
Created August 14, 2017 14:29
extension/package VS Code
{
"vue-snippet": "https://marketplace.visualstudio.com/items?itemName=hollowtree.vue-snippets",
"Vetur": "https://marketplace.visualstudio.com/items?itemName=octref.vetur",
"WakaTime": "https://marketplace.visualstudio.com/items?itemName=WakaTime.vscode-wakatime",
"JavaScript (ES6) code snippets": "https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets",
"Nord": "https://marketplace.visualstudio.com/items?itemName=arcticicestudio.nord-visual-studio-code",
"Material Icon Theme": "https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme",
"Auto Rename Tag": "https://marketplace.visualstudio.com/items?itemName=arcticicestudio.nord-visual-studio-code",
"Auto Close Tag": "https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag"
}
@CMarzin
CMarzin / basicComponentSnippetVue.json
Created August 14, 2017 14:12
Snippet vue for VS Code
"Basic Vue component": {
"prefix": "vue",
"body": [
"<template>",
"</template>",
"$2",
"<script>",
"export default {",
" name: '',",
" data () {",
@CMarzin
CMarzin / gist:8df1e7710b42079266c1941e5d72535c
Created August 14, 2017 13:58
Settings Visual Studio Code
{
"workbench.colorTheme": "Nord",
"workbench.activityBar.visible": true,
"workbench.statusBar.visible": true,
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
"emmet.useNewEmmet": false,
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue-html": "html",
@CMarzin
CMarzin / CMarzin
Created December 9, 2016 11:30
Detect sylabe french
<HTML>
<HEAD>
<script type="text/javascript">
function compterSylabeTexte()
{
var voyelle = "aàâeëéèêiïouùy";
var consonne = "bcçdfghjklmnpqrstvwxyz";
var ponctuation = ",;:!?.";
var texte = document.getElementById("zoneTexte").value;