Skip to content

Instantly share code, notes, and snippets.

View bpesquet's full-sized avatar

Baptiste Pesquet bpesquet

View GitHub Profile
@bpesquet
bpesquet / gist:501c789f01e5bdeda90d
Last active June 6, 2017 11:10
Hashed password generation with Silex
$app->get('/hashpwd', function() use ($app) {
$rawPassword = 'secret';
$salt = '%qUgq3NAYfC1MKwrW?yevbE';
$encoder = $app['security.encoder.bcrypt'];
return $encoder->encodePassword($rawPassword, $salt);
});
@bpesquet
bpesquet / rpg_es2015.js
Last active September 17, 2015 13:10
Minimalist RPG example written with ES2015 syntax
class Character {
constructor(name, health, strength) {
this.name = name;
this.health = health;
this.strength = strength;
}
describe() {
return this.name + " has " + this.health +
" health points and " + this.strength + " strength";
@bpesquet
bpesquet / rpg_oloo.js
Created September 20, 2015 17:22
Minimalist RPG exemple written in the OLOO style
var Character = {};
Character.initCharacter = function (name, health, strength) {
this.name = name;
this.health = health;
this.strength = strength;
};
Character.attack = function (target) {
if (this.health > 0) {
var damage = this.strength;
console.log(this.name + " attacks " + target.name + " and deals " + damage + " damage");
@bpesquet
bpesquet / gist:935e365e31cc991cccdc
Created October 13, 2015 20:40
Deploy MySQL app on Heroku Europe
$ heroku create <appname> --region eu
$ heroku addons:create cleardb:ignite
$ heroku config | grep CLEARDB_DATABASE_URL
<Create DB with MySQL Workbench>
$ git push heroku master
@bpesquet
bpesquet / gist:969ea9a0b399cf9aeeac
Last active October 22, 2015 17:16
Create a new Jekyll course based on class-boilerplate
<create new repo on GitHub>
$ git clone <new repo URL>
$ git remote add boilerplate https://github.com/bpesquet/class-boilerplate.git
$ git fetch boilerplate
$ git merge boilerplate/master
@bpesquet
bpesquet / gist:79656dc16f0c2c03b3fb
Created October 28, 2015 22:16
Deploy Silex/MySQL app to OpenShift
$ git remote add openshift <openshift_git_repo_url>
$ git fetch openshift
$ git merge openshift/master -s recursive -X ours
$ touch .openshift/markers/use_composer
@bpesquet
bpesquet / RapportVisiteType.php
Last active March 22, 2016 15:45
Using Symfony choice form field type with Silex
// Classe RapportVisiteType
<?php
namespace GSB\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class RapportVisiteType extends AbstractType
{
@bpesquet
bpesquet / .gitattributes-lfs-unity
Last active December 7, 2022 22:37
.gitattributes file for LFS with Unity
* text=auto
# Unity files
*.meta -text -merge=unityamlmerge
*.unity -text -merge=unityamlmerge
*.asset -text -merge=unityamlmerge
*.prefab -text -merge=unityamlmerge
# Image formats
*.psd filter=lfs diff=lfs merge=lfs -text
@bpesquet
bpesquet / jupyterhub-install.md
Created September 17, 2018 12:26
JupyterHub installation on Ubuntu 16.04
  • Ubuntu 16.04
  • CUDA 9.2
  • cuDNN 7.1.4
  • TF dependancies
  • Anaconda 3 in /usr/local/anaconda3
  • Clone TF 1.8
  • Compil TF (Python 3.6 par défaut)
  • Build package TF
  • sudo visudo. Add /usr/local/anaconda3/bin at end of secure_path
  • sudo pip install tensorflow*.whl
@bpesquet
bpesquet / .eslintrc.json.expo
Created January 31, 2019 00:12
ESLint configuration file for Expo SDK 32+
{
"extends": ["airbnb", "prettier", "prettier/react"],
"parser": "babel-eslint",
"env": {
"react-native/react-native": true
},
"plugins": ["react", "react-native"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true