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
using (ZipArchive archive = ZipFile.Open(@"c:\frenchcoding\start.zip", ZipArchiveMode.Update)) | |
{ | |
archive | |
.GetEntry("test_compress2.txt") | |
.Delete(); | |
archive | |
.GetEntry("test_compress3.txt") | |
.Delete(); | |
} |
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
public IEnumerable<int> Fibonacci(int x) | |
{ | |
int prev = -1; | |
int next = 1; | |
for (int i = 0; i < x; i++) | |
{ | |
int sum = prev + next; | |
prev = next; | |
next = sum; | |
yield return sum; |
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
foreach (var x in YieldTest.Fibonacci(10)) | |
{ | |
System.Console.WriteLine(x); | |
} |
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
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.tabs.captureVisibleTab(tab.windowId, {"format": "png"}, function(img) { | |
window.open(img); | |
}); | |
}); |
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
Response.Status = "301 Moved Permanently"; | |
Response.AddHeader("Location", "/"); |
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
array_elements = ['table', 'chair', 'floor'] | |
array_elements.each do | element | | |
puts "#{element} est dans la liste!" | |
end |
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
async Task<int> AccessTheWebAsync() | |
{ | |
HttpClient client = new HttpClient(); | |
Task<string> getStringTask = client.GetStringAsync("http://msdn.microsoft.com"); | |
GrosseEtLongueTache(); | |
string urlContents = await getStringTask; | |
return urlContents.Length; | |
} |
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
var x = function func(){ | |
//rien, juste pour l'exemple | |
} | |
x.prototype.log = function() { | |
console.log("2"); | |
} | |
var a = new x(); | |
a.log(); //retourne "2" |
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
require 'sinatra' | |
get '/' do | |
'FrenchCoding' | |
end |
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
require 'sinatra' | |
require 'base64' | |
require 'haml' | |
require 'securerandom' | |
set :static, true | |
set :public_folder, '/uploads' | |
get '/' do | |
haml :index |