Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
brahimmachkouri / interfaces
Created November 11, 2014 16:44
muliple ssids
# put the following content in /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
@brahimmachkouri
brahimmachkouri / interfaces
Created November 11, 2014 14:31
raspbian : wifi settings
#paste these lines in /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
wpa-ssid your-ssid-here
@brahimmachkouri
brahimmachkouri / form.php
Last active August 29, 2015 14:06
Simple form example with Silex
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
'locale_fallbacks' => array('en'),
));
$app->register(new Silex\Provider\FormServiceProvider());
$form = $app['form.factory']->createBuilder('form')
->add('name')
->add('email')
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
<script type="text/javascript">
var myJson = new Array();
$(document).ready(function() {
// Pas en asynchrone pour le dev (debug)
/*$.ajaxSetup({
async: false
});
*/
@brahimmachkouri
brahimmachkouri / default
Last active November 30, 2017 17:31
nginx userdir + php-fpm
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/chroot/home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;