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
// On définit une route | |
$app->match('/headers', function(Application $app, Request $requete) { | |
return $requete->headers; | |
}); |
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
// This snippet demonstrates how to send a json object to the server | |
// and how to retrieve it from the server side to save it in a file | |
// CLIENT SIDE : PAGE.JS | |
// --------------------- | |
// Save stats to a file to retrieve values later | |
function saveToFile() { | |
var jsonArray = JSON.stringify(_stats); | |
console.log(jsonArray); | |
jsonArray = encodeURIComponent(jsonArray); |
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
// ------------------------------------- | |
// ALGORITHME DE CLUSTURING (JAVASCRIPT) | |
// ------------------------------------- | |
// REMARQUES : | |
// - L'affichage final des groupes n'est pas correctement structuré | |
// ce qui rend la lecture des points difficile. | |
// - Une seule itération de l'algo est faite. | |
// Il faudrait en faire plusieurs et s'arrêter si les centres ne bougent plus | |
// lors du re-calcul de ces derniers. |
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
/// <summary> | |
/// This function checks if the light theme is active | |
/// and select black icons if it's the case | |
/// </summary> | |
private void CheckIconTheme() | |
{ | |
// Get the current Phone Background Theme (dark or light) | |
SolidColorBrush brush = (SolidColorBrush)Resources["PhoneBackgroundBrush"]; | |
// If the light theme is active, |
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
import java.io.IOException; | |
import javax.xml.transform.Transformer; | |
import javax.xml.transform.TransformerConfigurationException; | |
import javax.xml.transform.TransformerException; | |
import javax.xml.transform.TransformerFactory; | |
import javax.xml.transform.stream.StreamResult; | |
import javax.xml.transform.stream.StreamSource; | |
import org.xml.sax.SAXException; | |
public class Styliser { |
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
// ----------------- | |
// Override Namespace | |
// ----------------- | |
WinJS.Namespace.define("override", { | |
// Add events on the page | |
init: WinJS.Class.define(function () { | |
WinJS.Navigation.addEventListener("beforenavigate", this.beforenavigate); | |
}), | |
// Execute additional code before navigation |
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
// Get the last articles from the blog | |
.get('/getblog', function (req, res) { | |
var jqueryPath = __dirname + "/public/js/jquery-2.1.1.min.js"; | |
jsdom.env( | |
"http://rootasjey.github.io/", | |
[jqueryPath], | |
function (errors, window) { | |
// Jquery object | |
var $ = window.$; |
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
/** | |
* A function which takes two arrays in argument and tells which number is bigger | |
* @param {array} n1 - an array of two string | |
* @param {array} n2 - an array of two string | |
* @return {number} - -1 if n1 > n2, 1 if n1 < n2, 0 if n1 = n2 | |
* A sample input could be : n1 = ['221', '134'], n2 = ['9', '300'] | |
* To understand the algorithm used: | |
* see http://villemin.gerard.free.fr/Wwwgvmm/Analyse/PuissCom.htm | |
*/ | |
function ComparePowers(n1, n2) { |
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
/** | |
* A function which takes two arrays in argument and tells which number is bigger | |
* The first array is composed of the number and its power as the second array | |
* @param {array} n1 - an array of two string | |
* @param {array} n2 - an array of two string | |
* @return {number} - -1 if n1 > n2, 1 if n1 < n2, 0 if n1 = n2 | |
* A sample input could be : n1 = ['221', '134'], n2 = ['9', '300'] | |
* To understand the algorithm used: | |
* see http://villemin.gerard.free.fr/Wwwgvmm/Analyse/PuissCom.htm | |
*/ |
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
// Install win2D (nuget package) | |
// ParallaxImage is an Image Control in my Page.xaml | |
// ParallaxCanvas is a Canvas Control on my Page.xaml | |
// ParallaxCanvas contains ParallaxImage, so ParallaxCanvas is the parent of ParallaxImage | |
Visual _backgroundVisual = ElementCompositionPreview.GetElementVisual(ParallaxImage); | |
Compositor _backgroundCompositor = _backgroundVisual.Compositor; | |
GaussianBlurEffect blurEffect = new GaussianBlurEffect() { |
OlderNewer