Skip to content

Instantly share code, notes, and snippets.

@Fabax
Fabax / mask1.pde
Created October 19, 2014 13:47
Processing : mask pgraphic
PGraphics s, m;
void setup(){
size(220,220);
// Create a cookie cutter.
// White areas are kept. Black areas are not.
m = createGraphics( width, height, P2D );
m.beginDraw();
m.background(0);
m.fill(255);
@Fabax
Fabax / centerAbsolute.css
Created November 20, 2014 10:58
center absolute div
#center{
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}
@Fabax
Fabax / traitement winlose
Created February 6, 2013 16:53
traitementwinlose
<?php
// informations twitter
$consumerKey = '6232ltTfgbQobfF7KTw6Gg';
$consumerSecret = 'OP5yeGLSgdmAB1JHerfgRkelFFSMxsWUIxz3oy0s';
$oAuthToken = '621155088-GCelvA9yeTXRzdqp7QTcuO9DjKv0W7nqAqJNJb6Q';
$oAuthSecret = 'NPW9TfOIR81kazfsmyoByDjfJAxdFaBqgEqVqKus';
require_once('twitter/twitteroauth.php');
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
//information de la DB
@Fabax
Fabax / csvtoxml.php
Created February 6, 2013 19:17
PHP : csvToXml
<?php
$dirStart = "csv";
//$dirEnd = xml
if ($handle = opendir($dirStart)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$splitted = explode('.', $entry);
@Fabax
Fabax / autotweet.php
Created February 6, 2013 19:19
JS : AutoTweet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Clichy Tigers</title>
@Fabax
Fabax / traitementAutotweet.php
Created February 6, 2013 19:19
PHP : AutoTweet traitement
<?php
if(isset($_POST['new_tweet']))
{ #[a-z]#
$random = rand(1,7);
$consumerKey = 'lCZMlvltc7Fy84eOJLh0fg';
$consumerSecret = 'hGVSBcsJYDLtXu4apNOMGM0ec6yBQvGpdCiKGhOChQ';
$oAuthToken = '1020259956-n42wkK3PrBtVBcTR8oWyS8kWg3hcVCfc74aId0P';
$oAuthSecret = 'yPwYJerYxySbj7dSpJBYZ6mv2ZK1i4cOhbrlFSlJJA';
require_once('twitteroauth.php');
size(400, 400);
noStroke();
background(23, 100, 240);
float x = 0;
while (x < width) {
float y = 0;
while (y < height) {
// in rare cases, paint using red color
if (random(100) > 98) {
float rot = 0;
void setup() {
size(400, 400);
background(100, 200, 50);
smooth();
noStroke();
}
void draw_rotating_rectangle(float x, float y, float rect_size, float r) {
translate(x, y);
@Fabax
Fabax / requete sql 1
Created August 21, 2013 16:15
Exemple de requete sql
try {
$sqlResquest = 'SELECT u1.user_id as user_id1,
u1.user_fname as user_fname1,
u1.user_lname as user_lname1,
u1.user_email as user_email1,
u1.user_duos as user_duos1,
u1.user_answers as user_answers1,
u1.user_img as user_img1,
d.duo_status as duo_status,
d.duo_id as duo_id,
<?php
$req = $bdd->prepare('INSERT INTO jeux_video(nom, possesseur, console, prix, nbre_joueurs_max, commentaires)
VALUES(:nom, :possesseur, :console, :prix, :nbre_joueurs_max, :commentaires)');
$req->execute(array(     'nom' => $nom,     'possesseur' => $possesseur,     'console' => $console,     'prix' => $prix,     'nbre_joueurs_max' => $nbre_joueurs_max,     'commentaires' => $commentaires     ));   echo 'Le jeu a bien été ajouté !'; ?>