Skip to content

Instantly share code, notes, and snippets.

View Nrgy's full-sized avatar

Nrgy - Cédric Burceaux Nrgy

View GitHub Profile
@Nrgy
Nrgy / gist:999deab4ea4a9394edbea3d1290a18ac
Created March 10, 2017 13:37
Exercice SmartSide _ NombrePlusProcheDeZero
[TestClass]
public class UnitTest1
{
[TestMethod]
public void ListeVide_Renvoie_Zero()
{
ChercheurDeNombre chercheur = new ChercheurDeNombre();
int nombrePlusProche = chercheur.TrouveNombrePlusProcheDeZero(new List<int>());
Assert.AreEqual(0,nombrePlusProche);
}
var tour;
tour = new Tour({
name: "tour",
container: "body",
smartPlacement: true,
backdrop: "true",
backdropPadding: 5,
template: "" +
"<div class='popover' role='tooltip'>" +
"<div class='arrow'></div>" +
@Nrgy
Nrgy / TaylorTag.cs
Last active November 9, 2015 19:27
TaylorTag
static void Main(string[] args)
{
Type t = Type.GetTypeFromProgID("Shell.Application");
dynamic shell = Activator.CreateInstance(t);
var objFolder = shell.NameSpace(@"F:\Development\JunkProjects\TaylorTags\TaylorTags\images");
List<string> arrHeaders = new List<string>();
for (int i = 0; i < short.MaxValue; i++)
@Nrgy
Nrgy / ConnectToOneDrive
Last active September 7, 2015 14:23
Connexion à OneDrive
using (var context = new ClientContext(ConfigurationManager.AppSettings["onedrive:urlSite"]))
{
var passWord = new SecureString();
foreach (var c in ConfigurationManager.AppSettings["onedrive:password"]) passWord.AppendChar(c);
context.Credentials = new SharePointOnlineCredentials(ConfigurationManager.AppSettings["onedrive:login"], passWord);
Web web = context.Web;
// Vous pourrez ainsi intéragir sur le contenu de votre site
// Ici, nous allons récupérer l'ensemble des dossiers à la racine de la bibliothèque par défaut, ayant pour nom "Documents"
List docs = web.Lists.GetByTitle("Documents");