Skip to content

Instantly share code, notes, and snippets.

View zyzo's full-sized avatar
🏠
Working from home

An Dang zyzo

🏠
Working from home
View GitHub Profile
@zyzo
zyzo / MockV3Aggregator-0.8.7.sol
Last active May 25, 2022 21:03
MockV3Aggregator-0.8.7.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
/**
* @title MockV3Aggregator
* @notice Based on the FluxAggregator contract
* @notice Use this contract when you need to test
* other contract's ability to read data from an
#include <stdlib.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
#define length 1000
#define file "xml.txt"
//Export
@zyzo
zyzo / OntoParser.java
Last active January 14, 2020 20:22
5 € une copie
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@zyzo
zyzo / nodejs.ics
Created May 17, 2015 21:09
nodejs.ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//lanyrd.com//Lanyrd//EN
X-ORIGINAL-URL:http://lanyrd.com/topics/nodejs/nodejs.ics
X-WR-CALNAME;CHARSET=utf-8:Node.js conferences
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
SUMMARY;CHARSET=utf-8:NearForm's Building Production Node.js Systems
LOCATION;CHARSET=utf-8:Dublin\, Ireland
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
</head>
<body>
<label for="latInput">Latitude</label>
<input id="latInput"/>
<label for="lngInput">Longitude</label>
<input id="lngInput"/>
<div id="map"></div>
@zyzo
zyzo / avl.pl
Last active August 29, 2015 14:20
TP1 Intelligence Artificielle - 4IR
%***************************
% Gestion d'un AVL en Prolog
%***************************
%***************************
% INSA TOULOUSE - P.ESQUIROL
% mars 2015
%***************************
%*************************
@zyzo
zyzo / build.gradle
Created January 16, 2015 14:13
Example of gradle tasks grabbed from the documentation http://www.gradle.org/docs/current/userguide/tutorial_using_tasks.html
// Declare task
task hello {
doLast {
println "Hello world !"
}
}
// Dynamic creation of a task
task helloShorcut << {
@zyzo
zyzo / Exo2-XQuery.xql
Last active August 29, 2015 14:13
Exercice de MDSI (Modele de donnees et Systeme d'Info) - 4eme annee Info INSA de Toulouse
xquery version "3.0";
element Partie2 {
element FilmsQueJoueSigourneyWeaver {
for $x in doc("Films.xml")//film
where data($x//acteur) = "Sigourney Weaver"
return element titre {$x//titre}
},
element InfoRealisateursFilmAlien {
@zyzo
zyzo / configure-gmail-as-relay-smtp
Created December 30, 2014 13:24
configure gmail as relay smtp using postfix
Steps to configure this server to send mail via gmail relay
1. Download postfix and required packages
sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules
2. Configure gmail as relay host : in /etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
smtpd_sasl_auth_enable = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
@zyzo
zyzo / leCompteEstBon.pl
Created December 17, 2014 00:58
Programme solveur du jeu Le Compte Est Bon
/**
* Programme solveur du jeu Le Compte Est Bon.
* Donnees : - Ensemble P de six nombres P = [P1, P2, P3, P4, P5, P6],
* chaque nombre tire aleatoirement parmi 1,2,3,4,5,7,8,9,10,25,50,75,100]
* - Nombre cible N
* Objectif : Trouver un ensemble d'oprations (+,-,*,// division entiere) utilisant
les nombres de P qui conduisent a N. Le tirage des nombres est sans remis
*/