Skip to content

Instantly share code, notes, and snippets.

View ludoo0d0a's full-sized avatar

LudoO ludoo0d0a

View GitHub Profile
@ludoo0d0a
ludoo0d0a / git pull force
Created May 1, 2015 17:40
Git Resync on remote - Local changes lost
git stash --include-untracked
git pull
@ludoo0d0a
ludoo0d0a / KODI remote.xml
Created May 1, 2015 17:44
XBMC / Kodi - Adds missing remote control menu control (yellow=pause, red=contextual menu, green=fullscreen) [keymaps/remote.xm]
<keymap>
<global>
<remote>
<red>ContextMenu</red>
<green>FullScreen</green>
<yellow>Pause</yellow>
<blue>Info</blue>
</remote>
</global>
<FullscreenVideo>
@ludoo0d0a
ludoo0d0a / gist:2e67eb2e4d01cbb945f0
Created August 11, 2015 09:58
Git undo lastcommit
git reset --soft HEAD~1
source: http://davidwalsh.name/git-undo-commit
@ludoo0d0a
ludoo0d0a / magicsquare_solver.py
Created September 28, 2012 09:29
Magic square complete solver
'''
Complete solver for all magic square
with preset
Created on Sep 28, 2012
@author: ludoo
'''
from constraint import *
@ludoo0d0a
ludoo0d0a / bookmarklet.js
Created March 20, 2017 13:04
Download photos facebook messenger bookmarklet
javascript:var r=[],x=document.getElementsByClassName('_16zz')[0],imgs=x.getElementsByTagName('a');for(i=0;i<imgs.length;i++){var url=imgs.item(i).getAttribute('href');r.push('<img src="'+url+'"/>');}document.write('<p>Press Ctrl+s to save complete page ; pictures will be in the folder aside the html page</p>'+r.join('<br/>'));
@ludoo0d0a
ludoo0d0a / gist:2704333073b56742510e328b5d055271
Created September 4, 2017 20:26 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ludoo0d0a
ludoo0d0a / font-inspector.js
Created September 12, 2017 15:13
<Font inspector> To list all unicodes glyph characters for a font family on an already existing web site.
/*eslint-disable */
/*
Copy paste this code in Chrome console. Then execute
fontlist('MyFontFamily', 0, 200);
It will display the dictionary for all characters and their mapping with the right rendered glyph.
*/
function fontlist(name, start, end, range){
var ID = 'font-list', IDS= 'style-'+ID;
range=range||'f';
start=start||0;
@ludoo0d0a
ludoo0d0a / docker-compose.yml
Created November 25, 2017 13:21
Docker configuration for Elasticsearch 6 (cluster 2 nodes) + Kibana 6 (version OSS)
version: "2.2"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@ludoo0d0a
ludoo0d0a / gist:b2f910b9591849a09270cb49b94f30f5
Last active November 1, 2018 15:46
Update / upgrade firmware Synology DSM - System partition size issues
Impossible de faire la mise à jour Synology DSM:
Message d'erreur:
Capacité insuffisante pour la mise à jour. La partition système requiert au moins 400 Mo
Solution:
Se connecter en ssh au nas:
```bash
sudo du -d 3 -xm /
ou (pour obtenir les 10 plus gros répertoires)
@ludoo0d0a
ludoo0d0a / git fetch all remote branches
Created November 4, 2018 21:19
Git - Fetch all remote branches in one command
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done