Skip to content

Instantly share code, notes, and snippets.

View thiphariel's full-sized avatar
💤

Thiph thiphariel

💤
  • 07:58 (UTC +02:00)
View GitHub Profile
@thiphariel
thiphariel / st3-plugins.txt
Last active October 3, 2017 08:23
Sublime text 3 plugins
- A File Icon
- Advanced new file
- Alignment
- Color Picker
- DocBlokr
- Emmet
- Emmet Css Snippets
- GitGutter
- Material Theme
- Pretty JSON
@thiphariel
thiphariel / workspace.desktop
Last active September 1, 2017 22:04
Workspace Arch Linux (GNOME)
# ~/.config/autostart/workspace.desktop
[Desktop Entry]
Name=Workspace
GenericName=Workspace
Comment=Move apps on correct workspace
Exec=/home/thiphariel/workspace.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
@thiphariel
thiphariel / app.js
Created August 26, 2017 16:42
Simple, complete example of a bot in Discord.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
@thiphariel
thiphariel / jwt.php
Created August 17, 2017 01:29
JWT generation
<?php
/**
* Created by PhpStorm.
* User: thiphariel
* Date: 15/08/17
* Time: 19:40
*/
namespace App\Api;
@thiphariel
thiphariel / swap.sh
Created July 8, 2017 11:22
Swap rasp
# /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
# /sbin/mkswap /var/swap.1
# /sbin/swapon /var/swap.1
@thiphariel
thiphariel / .zshrc
Last active October 4, 2017 08:05
Zsh config Arch Linux
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/thiphariel/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
@thiphariel
thiphariel / packages.txt
Created June 29, 2017 02:10
Liste des paquets installés sur Arch linux
[Etrangers]
android-studio
capitaine-cursors
discord
google-chrome
nerd-fonts-source-code-pro
spotify
@thiphariel
thiphariel / getImageLocation.php
Last active May 9, 2017 22:45
JPEG / TIFF Location
/**
* Retrive the location of the given image or return false
*/
private static function getImageLocation($file) {
if (is_file($file)) {
$info = exif_read_data($file);
if ($info !== false) {
$direction = array('N', 'S', 'E', 'W');
if (isset($info['GPSLatitude'], $info['GPSLongitude'], $info['GPSLatitudeRef'], $info['GPSLongitudeRef']) &&
in_array($info['GPSLatitudeRef'], $direction) && in_array($info['GPSLongitudeRef'], $direction)) {
@thiphariel
thiphariel / bash.sh
Created May 5, 2017 20:49
MacOS terminal host name
$ scutil --set HostName "name"
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then