Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
lduboeuf / gist:b3fccd35e36d2bf30309
Created May 11, 2015 08:12
exemple abonnements évènements js /html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<style>
#error_message {
color: red;
}
@lduboeuf
lduboeuf / gist:0228e1009a0133a211c0
Last active August 29, 2015 14:20
exemple utilisation objet json
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form>
<input type="text" id="lastname" placeholder="nom"/>
@lduboeuf
lduboeuf / gist:cfa28da97f91feaca260
Last active October 28, 2015 10:31
exemple mini-todo app pure js
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<script>
var todos = [
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@lduboeuf
lduboeuf / gist:5987f017f13c33c34bb1
Created May 13, 2015 08:24
todo jquery: effet fadeIn sur les todo + todo editable en double cliquant dessus
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@lduboeuf
lduboeuf / gist:571bc66f3f713804d56e
Created May 19, 2015 09:20
utilisation objet php
//TypeFilm.php est le fichier qui contient la déclaration de la classe TypeFilm
include('TypeFilm.php');
//creation de 2 instances, ici le constructeur de la classe permet de créer un TypeFilm avec un code et un libellé.
$tFilm = new TypeFilm("AVE", "Aventure");
$tFilm2 = new TypeFilm("COM", "Comedie");
//ajout au tableau (collection)
$ltypeFilms = array();
array_push($ltypeFilms, $tFilm);
@lduboeuf
lduboeuf / gist:25c6979dbb814acf5870
Last active October 21, 2015 18:48
hello world with Silex, use of json_encode
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Symfony\Component\HttpFoundation\Response;
$app = new Silex\Application();
$app['debug'] = true;
--comment here
local str = "i'm a string"
local isOK = true
local number = 5
local decimal = 5.2
local car = 'T'
a, b, c = 1, 2, 3 --global vars: a==1, b==2, c==3
local atable = {1,2,3} -- simple table
function hello()
@lduboeuf
lduboeuf / lua_firstep.lua
Created February 1, 2017 09:53
lua first step 2
local firstname = "lionel"
local display = print
display(firstname)
--table as associative array
local person = {
firstname = "lilil",
developer = true,
score = 150000,
@lduboeuf
lduboeuf / gist:6a9ab59dfc0cf85798439af7acd4309b
Last active February 8, 2017 08:19
client java - parse WS json rest
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.lduboeuf.todo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;