This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////////////////////////////////////////////////////////////////////// | |
//////////////////////// METHODOLOGIE SEPARÉE //////////////////////// | |
////////////////////////////////////////////////////////////////////// | |
// app/controllers/UsersController --------------------------------- / | |
class UsersController | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// la l.2 fait la même chose que la l.5/6 | |
$jobs = Job::lists('name', 'id'); | |
// Ancien | |
$jobs = Job::all(); | |
foreach($jobs as $job) { $jobArray[$job->id] = $job->name; } | |
// Les 2 renvoies le même array : | |
array (size=14) | |
2 => string 'Gérant de projet' (length=17) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enregistre toute les requêtes éffectué une par une dans un array | |
$query = DB::getQueryLog(); | |
// affiche la dernière requête qui est executé | |
$last_query = end($query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- installer/configurer le remote (dans config/remote.php) | |
- installer/configurer Rockesteer de Maxime Fabre | |
- installer git et composer sur le serveur | |
- configurer le serveur apache | |
- activerle mod_rewrite (pour que la réecriture fonctionne) | |
- comande : 'a2enmod rewrite' / 'a2enmod apache2 enable mod' | |
Ps : activer pour sous domaine | |
- 'a2ensite' | |
- tester que tout est bon : artisan deploy:check (verifie que ça fonctionne) | |
- deployer la production : artisan deploy:deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Système d'autocomplete | |
$(function() { | |
$("#address").autocomplete({ | |
// 3 lettres minimums avant que l'autocomplete s'enclenche | |
minLength: 3, | |
source: function(request, response) { | |
// Nous récupérons l'adresse et recupérons ce qu'on à besoin | |
geocoder.geocode( {'address': request.term }, function(results, status) { | |
// Response : jquery ui | |
response($.map(results, function(item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Si on passe les dépendances manuellement | |
class HTML | |
{ | |
function __construct(URL $url) | |
{ | |
$this->url = $url; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Les instances en temps normal | |
////////////////////////////////////////////////////////////////////// | |
// En PHP, quand on a une classe non-statique, il faut d'abord l'instancier | |
// en faisant `new MyClass`. On place cette instance dans une variable, ensuite | |
// on appelle les méthodes sur la variables, comme ceci : | |
$elastica = new Elastica\Client('123456789'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT 'http://site:[email protected]/ptf/products/_mapping' -d | |
'{"products":{"properties":{"deleted_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"description":{"type":"string"},"location":{"type":"geo_point"},"photo":{"type":"string","index":"not_analyzed"},"price":{"type":"float"},"quantity":{"type":"string"},"shared_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"created_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"expiry_at":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"},"title":{"type":"string"},"user":{"properties":{"email":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"},"photo":{"type":"string","index":"not_analyzed"}}}}}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Akeru.h> | |
#include <LPD8806.h> | |
#include "SPI.h" // Comment out this line if using Trinket or Gemma | |
#include <SoftwareSerial.h> | |
/* | |
Double Analog input, Double analog output, serial output | |
Reads from two analog input pins, a T000020 Accelerometer Module connected | |
to I0 and I1, maps the result to a range from 0 to 255 | |
and uses the result to set the pulsewidth modulation (PWM) on two T010111 |
OlderNewer