Skip to content

Instantly share code, notes, and snippets.

View Metrakit's full-sized avatar
🤘
Coding

Jordane Metrakit

🤘
Coding
View GitHub Profile
@Metrakit
Metrakit / gist:e828ae8d00651271262477aed3a04834
Created October 25, 2016 11:09
PHP test RSA public key
<?php
$public_key = "-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0
FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/
3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB
-----END PUBLIC KEY-----";
$test = openssl_pkey_get_public($public_key);
http://www.lottejackson.com/learning/supports-will-change-your-life
@Metrakit
Metrakit / gist:738f23b2e96c5f1f4ac67db8e707e35d
Created September 7, 2016 11:58
Set a global url for Vue-resource
Vue.http.options.root = 'https://top-serveurs.net'
@Metrakit
Metrakit / gist:0abbd4309835e0c378993245378cf7bb
Created August 24, 2016 19:57
Unban on Fail2ban : the awesome Tips !
# Display the banned IPs with jail names :
iptables -L
# Unban an IP :
iptables -D jail-name -s IP-HERE -j REJECT or DROP or ...
e.g. :
iptables -D fail2ban-recidive -s 127.0.0.1 -j REJECT
@Metrakit
Metrakit / DropboxServiceProvider.php
Last active August 9, 2016 10:05
ServiceProvider for Dropbox
<?php
namespace App\Providers;
use Storage;
use League\Flysystem\Filesystem;
use Dropbox\Client as DropboxClient;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Dropbox\DropboxAdapter;
opcache.revalidate_path=1
setlocale(LC_TIME, 'fr_FR.utf8');
Carbon\Carbon::now('Europe/Paris')->formatLocalized('%A %d %B %Y');
#!/usr/bin/env bash #adding this to force silly gist highlighting. REMOVE THIS
# This is a modified version of the script generated by https://docs.npmjs.com/cli/completion to include `npm install` autocompletion.
# Basically we added `if` blocks to check for `install` subcommand.
###-begin-npm-completion-###
#
# npm command completion script
#
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc)
@Metrakit
Metrakit / gist:8adcda2ddf2aa7175f365eca2b396f46
Last active May 20, 2016 13:06
Example jQuery function
$.fn.extend({
loadSubmit: function (keepSize) {
if (keepSize == undefined) {
keepSize = true;
}
var submitBtn = $(this).find('.btn-submit');
if (keepSize) {
submitBtn.css('width', submitBtn.outerWidth(true) + 'px');
}
@Metrakit
Metrakit / gist:fd9996fe6dae517caa5bae03207f2b45
Created May 11, 2016 12:58
Use vuejs variables in .blade.php file
@{{ vue-variable }}