Skip to content

Instantly share code, notes, and snippets.

@Shaltz
Shaltz / gist:6657ae768933c774cd6b
Last active August 29, 2015 14:15
Sublime text shortcut and custom keybinding
Toggle console
{ "keys": ["ctrl+alt+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
Autocomplete suggestions (for linux)
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
@Shaltz
Shaltz / gist:ae5a4dfeaff6c4e0378c
Created March 1, 2015 21:41
LINUX - Repair FAT32 sdcard/USBdrive
sudo dosfsck -w -r -l -a -v -t /dev/sdc1
@Shaltz
Shaltz / what2do
Created March 26, 2015 10:30
Linux / Ubuntu : Repair USB key Read Only Error
sudo su -
df -Th
umount 'mounted on name from df'
dosfsck -a 'FileSystem name from df'
@Shaltz
Shaltz / gist:63142c3fc4c1c09e66ad
Last active August 29, 2015 14:18
Installation d'un poste de dev sous linux
====== Installation poste Linux ======
===== Quick version =====
<code>
sudo apt-add-repository ppa:git-core/ppa ; sudo apt-get update ; sudo apt-get install vim build-essential curl httpie meld ruby chromium-browser pepperflashplugin-nonfree avahi-discover gimp inkscape imagemagick libav-tools vlc handbrake git-core gitg tig qreator shutter php5 php5-cgi; git config --global color.ui auto ; git clone https://github.com/creationix/nvm.git ~/.nvm ; cd ~/.nvm ; git checkout `git describe --abbrev=0 --tags` ; echo -e "source ~/.nvm/nvm.sh\nnvm use stable" >> ~/.bashrc ; . ~/.nvm/nvm.sh ; nvm install stable ; nvm use stable ; sudo npm install -g bower grunt-cli coffee-script httpster coffeelint
</code>
===== POSTINSTALL =====
(http://itsfoss.com/things-to-do-after-installing-ubuntu-1504)
@Shaltz
Shaltz / gist:aa51170541a2ec4e9184
Last active August 29, 2015 14:19
function et variables MAGIQUES PHP utiles
Variables MAGIQUES (superGlobales)
$_SERVER : ce sont des valeurs renvoyées par le serveur. Elles sont nombreuses et quelques-unes d'entre elles peuvent nous être d'une grande utilité.
$_SERVER['REMOTE_ADDR']. Elle nous donne l'adresse IP du client qui a demandé à voir la page, ce qui peut être utile pour l'identifier.
$_ENV : ce sont des variables d'environnement toujours données par le serveur. C'est le plus souvent sous des serveurs Linux que l'on retrouve des informations dans cette superglobale. Généralement, on ne trouvera rien de bien utile là-dedans pour notre site web.
$_SESSION : on y retrouve les variables de session. Ce sont des variables qui restent stockées sur le serveur le temps de la présence d'un visiteur. Nous allons apprendre à nous en servir dans ce chapitre.
$_COOKIE : contient les valeurs des cookies enregistrés sur l'ordinateur du visiteur. Cela nous permet de stocker des informations sur l'ordinateur du visiteur pendant plusieurs mois, pour se souvenir de son nom par exemple.
$_GET
@Shaltz
Shaltz / gist:85560457c16a0970e2bf
Created April 23, 2015 09:05
dev tricks and commands (on Ubuntu)
restart apache server: sudo /etc/init.d/apache2 restart
show php infos in html page : <?php phpinfo(); ?>
@Shaltz
Shaltz / gist:5f8829c6fd8e7d08422c
Created June 4, 2015 15:27
Param apache / PHP for Symfony
# Edit /etc/php5/apache2/php.ini
# & /etc/php5/cli/php.ini
uncomment date.timezone
# add
date.timezone = "Europe/Paris"
@Shaltz
Shaltz / gist:38d5570538967bf13a23
Last active August 29, 2015 14:23
Laravel TIPS & TRICKS
to setup an Ubuntu Apache server to work properly with Laravel :
1) Enable mod_rewrite on the apache server: sudo a2enmod rewrite
2) edit /etc/apache2/apache2.conf, changing the "AllowOverride None" directive for "/var/www" to "AllowOverride All"
Then restart the Apache server: service apache2 restart
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@Shaltz
Shaltz / gist:dc99bd0a827a51f93b32
Created June 23, 2015 12:04
Bluetooth on Ubuntu for Asus N53SV
rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: asus-wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
2: asus-bluetooth: Bluetooth
Soft blocked: no
@Shaltz
Shaltz / gist:d13103b787246cc77cc7
Created June 23, 2015 16:10
Wiimote WhiteBoard on Ubuntu 15.04 for ASUS N53SV
Download the cross-platform Java version of WiimoteWhiteBoard (http://www.uweschmidt.org/wiimote-whiteboard) and unzip the archive (folder WiimoteWhiteboard will be created)
Go to the WiimoteWhiteboard folder and create a new sub-directory lib
Download the latest GPL’d BlueCove Linux library (http://bluecove.googlecode.com/files/bluecove-gpl-2.1.0.jar) and put it in the lib folder
Type zip WiimoteWhiteboard.jar lib/bluecove-gpl-2.1.0.jar at the command-line in folder WiimoteWhiteboard
That’s it. The software should start normally by typing java -jar WiimoteWhiteboard.jar