Skip to content

Instantly share code, notes, and snippets.

View tisseurdetoile's full-sized avatar
🏠
confiné

tisseurdetoile tisseurdetoile

🏠
confiné
View GitHub Profile
@tisseurdetoile
tisseurdetoile / Singleton.java
Created November 3, 2017 14:19
Java/4/6 stuff
/**
* Singleton Class Sample.
*/
public class SimpleSingleton {
private static SimpleSingleton singleInstance = new SimpleSingleton();
//Marking default constructor private
//to avoid direct instantiation.
private SimpleSingleton() {
}
@tisseurdetoile
tisseurdetoile / vimdiff.md
Created October 24, 2017 12:39 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@tisseurdetoile
tisseurdetoile / gist:e0abcc3296e9cc0caf25a3ba83af3ac5
Created June 1, 2017 09:09
List properties keeping only desired properties and displaying file name.
tail -n +1 *.properties | grep -e %%PROPERTIE_ -e '==.*'

Keybase proof

I hereby claim:

  • I am tisseurdetoile on github.
  • I am tisseurdetoile (https://keybase.io/tisseurdetoile) on keybase.
  • I have a public key whose fingerprint is 7F23 54BD 49B6 D898 06E3 F727 01FE 54DC 8463 5A47

To claim this, I am signing this object:

@tisseurdetoile
tisseurdetoile / fetch_files.sh
Created January 22, 2017 19:26
fetch file ending with the alphet letter with curl pretending to firefox 3 on windows xp
#!/bin/bash
# fetch file ending with the alphet letter
# with curl pretending to firefox 3 on windows xp
#
for x in {a..z}
do
echo "http://www.website.com/letter_$x.pdf"
curl -silent -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" --remote-name http://www.website.com/letter_$x.pdf
done
@tisseurdetoile
tisseurdetoile / config_my_git
Last active September 28, 2016 14:21
Git configuration
git config --global user.name yourName
git config --global user.email yourMail@yourdomain.net
git config --global color.diff always
git config --global color.diff.frag magenta bold
git config --global color.diff.meta yellow bold
git config --global color.diff.whitespace red reverse
git config --global core.whitespace '-trailing'
git config --global diff.mnemonicPrefix true
git config --global diff.renames true
------------------------------------------------------------------------------
--
-- Copyright © 2016 Le TisseurDeToile <webmaster@tisseurdetoile.net> and released under
-- the GNU General Public License, v2 or later.
-- NOTA : don't forget to create variable
--
-- Installation :
-- Créer les variables Utilisateurs suivantes : CONSO_LAST, CONSO_LAST_HC, CONSO_LAST_HP
-- Créer deux capteur virtuel : Capteur electrique ent noter leur index
------------------------------------------------------------------------------
@tisseurdetoile
tisseurdetoile / git-shell-commands
Last active August 29, 2015 14:19
git-shell-commands example
# git-shell-commands
@tisseurdetoile
tisseurdetoile / post-receive
Created April 12, 2015 10:52
Hook in git repo for jekyll auto publish
#!/bin/bash -l
GIT_REPO=/opt/git/blog.git
TMP_GIT_CLONE=/tmp/awesomeblog
PUBLIC_WWW=/usr/share/nginx/www/jekyll/
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
@tisseurdetoile
tisseurdetoile / BACKUP.SH
Last active January 23, 2018 01:37
backup my PI to my NAS with rsync
#!/bin/bash
HOSTNAME=`hostname`
SERVER="SRVHOST"
USERNAME="USER"
export RSYNC_PASSWORD="password"
PREFIX="/backup"
AREXCLUDE=( "/dev/*" "/proc/*" "/sys/*" "tmp/*" "/run/*" "/mnt/*" "/media/*" "lost+found" "/usr/share/*" "/lib/*" "/var/lib/*" "/usr/lib/*" "/var/swap" "/var/cache/*" "/var/lock/*" "/var/run/*")
START=$(date +%s)
DAYNUM=`date '+%u'`