Skip to content

Instantly share code, notes, and snippets.

View dgellow's full-sized avatar
🐢
Pulu pulu 🏳️‍🌈

Sam El-Borai dgellow

🐢
Pulu pulu 🏳️‍🌈
View GitHub Profile
@dgellow
dgellow / ajaxSample.js
Last active December 10, 2015 06:59
Ajax sample
loadAsynchronous = function () {
var target = document.getElementById("divAsynchronous");
target.innerHTML = "Loading ...";
var request = new XMLHttpRequest();
var content = "";
request.onreadystatechange = function () {
if (request.readyState == 1) {
<title><?php print($title) ?></title>
<link><?php print($site)?></link>
<description><?php print(description)?></description>';
<?php foreach ($articles as $a) { ?>
<item>
<title> <?php print($a->getName()); ?></title>
<link><?php print($site) ?>/article.php?id= <?php print($a->getId()) ?></link>
<pubDate> <?php print(date("D, d M Y H:i:s")) ?></pubDate>
@dgellow
dgellow / gist:4714007
Last active December 12, 2015 04:28
QueryEngine - Module 151
<?php
/**
* Created by JetBrains PhpStorm.
* User: Samuel El-Borai, Thomas Jolain, Etienne Ischer
* Date: 21/01/13
* Time: 09:37.
*/
require_once("Query.php");
require_once("Database.php");
@dgellow
dgellow / gist:4714023
Last active December 12, 2015 04:28
Microsoft Access database - Multiple inner join syntax - Module 151
$query->SQL = "select a.id as id, a.prenom as prenom, a.nom as nom, a.pseudo as pseudo, a.email as email,
a.password as password, a.password_salt as password_salt, a.date_naissance as date_naissance, a.adresse as adresse,
a.date_inscription as date_inscription, a.date_modification,
b.nom as pays, b.indicatif as indicatif,
c.nom as ville,
d.nom as role,
e.num as npa,
f.nom as canton
from ((((t_utilisateur as a
inner join t_pays as b on a.fk_pays = b.id)
@dgellow
dgellow / gist:4714099
Created February 5, 2013 12:08
Template for RSS feed - Module 151
<?php
/**
* Created by JetBrains PhpStorm.
* User: dainii
* Date: 31/01/13
* Time: 15:36
* To change this template use File | Settings | File Templates.
*/
?>
@dgellow
dgellow / gist:4714103
Created February 5, 2013 12:09
Main template for RSS feed - Module 151
<?php
/**
* Created by JetBrains PhpStorm.
* User: dainii
* Date: 31/01/13
* Time: 17:18
* To change this template use File | Settings | File Templates.
*/
?>
<?php
@dgellow
dgellow / custom_bepow
Last active December 19, 2015 07:08
bépo layout customization
// fr-dvorak-bepo-intl
// Samuel El-Borai 2011
// Adaptations du clavier bepo, basé sur le travail de Kaze :
// http://bepo.fr/wiki/Utilisateur:Kaze/B%C3%A9po-intl
// La plus grande partie des modifications sont pour faciliter l'utilisation du
// bépo en programmation.
// Modifications :
// - déplacement des parenthèses sous <AltGr é> et <AltG p>
// - déplacement des crochets sous <AltGr u> et <AltGr i>
@dgellow
dgellow / evdev.xml
Created July 3, 2013 07:07
Custom /usr/share/X11/xkb/rules/evdev.xml to add my custom bepow layout to gnome 3 settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
<xkbConfigRegistry version="1.1">
<modelList>
<model>
<configItem>
<name>pc101</name>
<description>Generic 101-key PC</description>
<vendor>Generic</vendor>
</configItem>
@dgellow
dgellow / evdev.lst
Created July 3, 2013 07:09
Custom /usr/share/X11/xkb/rules/evdev.lst to add my custom bepow layout to gnome 3 settings
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@dgellow
dgellow / stream_to_twitch.sh
Created July 8, 2013 12:29
Linux streaming to twitch.tv
streaming() {
INRES="1440x900" # input resolution
OUTRES="1440x900" # Output resolution
FPS="35" # target FPS
QUAL="medium" # one of the many FFMPEG preset on (k)ubuntu found in /usr/share/ffmpeg
# If you have low bandwidth, put the qual preset on 'fast' (upload bandwidth)
# If you have medium bandwitch put it on normal to medium
STREAM_KEY="live_12345678_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234" # This is your streamkey generated by jtv/twitch found at: http://www.justin.tv/broadcast/adv_other
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+0,0 -itsoffset 00:00:01 -f alsa -ac 2 -i pulse -vcodec libx264 -vpre "$QUAL" -s "$OUTRES" -acodec libmp3lame -ab 96k -threads 6 -qscale 5 -b 1024kb -f flv "