This file contains hidden or 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
<html> | |
<head> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="main.css"> | |
</head> | |
<script type="text/javascript"> | |
var compteur = 5, | |
nb = Math.floor(Math.random() * 100), | |
resp = null; |
This file contains hidden or 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 | |
// here is my previous code, i open and save directly the original size and there was a transparency issue. | |
$imagine = new Imagine\Gd\Imagine(); | |
$image = $imagine->open($file->getTempName()) | |
->save('path'), array('quality' => 95)); | |
// with this, no more issue, because resize use the imagealphablending function |
This file contains hidden or 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 | |
list($new_w, $new_h) = $sizes; | |
$image = $imagine->open($file->getTempName()) | |
->resize(new Box($new_w, $new_h)) | |
->save($this->_getNewPath($directory), array('quality' => 95)); |
This file contains hidden or 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
tell application "Finder" | |
try | |
mount volume "smb://freebox" as user name "GUEST" | |
delay 1 | |
end try | |
end tell |
This file contains hidden or 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 | |
class Client{ | |
public function run(Repository $repository, $command) | |
{ | |
$descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w")); | |
$process = proc_open($this->getPath() . ' ' . $command, $descriptors, $pipes, $repository->getPath()); | |
if (!is_resource($process)) { | |
throw new \RuntimeException('Unable to execute command: ' . $command); |
This file contains hidden or 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
- Prendre le code | |
- Créer votre app | |
- Mettre l'url de retour dans les settings de votre app (section: Website with Facebook Login) | |
- Changer les clefs api dans le code | |
- Télécharger la lib fb pour php (github.com/facebook/facebook-php-sdk) | |
- Lancer et Profit! |
This file contains hidden or 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
{ | |
"name": "clement/test", | |
"description": "test", | |
"require": { | |
"silex/silex": "dev-master", | |
"symfony/form": "dev-master", | |
"twig/twig": "dev-master", | |
"fp/lightopenid": "dev-master" | |
}, |
This file contains hidden or 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
3 tables: Product, Category, ProductCategory | |
A product has many categories and a category can belong to many products. | |
The category objet is nestedset(via doctrine behavior) with a parent, and a position. | |
I need to be able to manage these categories (up/down/delete/new/edit) | |
I need to be able to add many categories to a product. | |
AFAIK, when a category (cat1) has a parent (cat0), and you want to add cat1 to a product, you need to add cat0 too. |
This file contains hidden or 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
assetic: | |
debug: %kernel.debug% | |
use_controller: false | |
filters: | |
cssrewrite: ~ | |
sass: ~ | |
yui_js: | |
jar: %kernel.root_dir%/java/yuicompressor.jar | |
yui_css: | |
jar: %kernel.root_dir%/java/yuicompressor.jar |
This file contains hidden or 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 | |
$str = htmlentities($str, ENT_NOQUOTES, $charset); | |
$str = preg_replace('#\&([A-za-z])(?:acute|cedil|circ|grave|ring|tilde|uml)\;#', '\1', $str); | |
$str = preg_replace('#\&([A-za-z]{2})(?:lig)\;#', '\1', $str); // pour les ligatures e.g. 'œ' | |
$str = preg_replace('#\&[^;]+\;#', '', $str); // supprime les autres caractères | |
NewerOlder