Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
namespace Blog_CSharpAsync
{
class Program
{
@brenoferreira
brenoferreira / AsyncAwait_CodeGeneratedByCompiler.cs
Created November 7, 2011 01:02
Async+Await under the covers
using System;
using System.Diagnostics;
using System.Net;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
[CompilerGenerated]
[StructLayout(LayoutKind.Auto)]
private struct <DownloadBingHomePageHTMLAsync>d__3 : <>t__IStateMachine
{
@brenoferreira
brenoferreira / asyncexamples.cs
Created November 15, 2011 00:57
Async Examples
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AysncWinForms
{
@brenoferreira
brenoferreira / unhidefolders.ps1
Created January 4, 2012 12:51
Unhide folders in Powershell
$dir = New-Object System.IO.DirectoryInfo("Folder")
$folders = $dir.GetDirectories()
$folders | ForEach-Object { $_.Attributes = [System.IO.FileAttributes]::Directory }
@brenoferreira
brenoferreira / azureUnicode.js
Created January 24, 2012 20:04
AzureTableNodeUnicode
var azure = require('azure');
var http = require('http');
var server = http.createServer(function(req, resp){
var storageAccount = 'account';
var storageKey = 'key';
var tableServiceClient = azure.createTableService(storageAccount, storageKey, azure.ServiceClient.CLOUD_TABLE_HOST);
tableServiceClient.createTableIfNotExists("tasks", function (res, created) {
@brenoferreira
brenoferreira / Index.jshtml
Created February 7, 2012 06:53
NSHTML (Razor View-Engine implementation for NodeJS) Example
<!doctype html>
<html>
<body>
<div>
@locals.person.FirstName
</div>
<div>
@brenoferreira
brenoferreira / index.html
Created February 27, 2012 14:39
Hello World in HTML with NodeJS
<!doctype html>
<html>
<body>
<p>Hello world! Node is awesome, is it not?</p>
</body>
</html>
@brenoferreira
brenoferreira / Client.java
Created March 14, 2012 00:23
Thread lock example
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package myservice;
/**
*
* @author vcamaral
*/
@brenoferreira
brenoferreira / server.js
Created March 14, 2012 02:38
Node.js + Python thread lock simulation
var net = require("net")
, fs = require("fs")
, filename = "messages.txt";
var server = net.createServer(function(socket) {
console.log("== Client connected");
socket.on("data", function(data) {
console.log("Client sent:", data.toString());
socket.write("Your message has sent to the server!\n");
@brenoferreira
brenoferreira / License.cs
Created June 8, 2012 20:18
Private methods
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace License
{
public class LicenseServiceImpl
{