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 System; | |
using MongoDB.Bson; | |
using MongoDB.Driver; | |
using MongoDB.Driver.Wrappers; | |
using Newtonsoft.Json; | |
namespace Mongothingies { | |
class Program { | |
static void Main() { | |
var server = MongoServer.Create(); |
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
// in App.xaml.cs | |
public partial class App : Application | |
{ | |
public static readonly MobileServiceClient MobileServiceClient; | |
public static User CurrentUser; | |
static App() | |
{ | |
// Get this data from the management portal's quickstart page | |
// in the 'connect to existing apps' section |
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 System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Windows.Forms; | |
using Microsoft.Office.Core; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using Excel = Microsoft.Office.Interop.Excel; |
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
// Humidity and temperature monitor | |
// for Arduino UNO R3 (and probably most others) | |
// Main pieces: | |
// DHT11 humidity/temp sensor | |
// - mandatory 10k pull-up resistor | |
// -> using DHT.f by adafruit at https://github.com/adafruit/DHT-sensor-library | |
// 16x2 LCD | |
// - 10K potentiometer for contrast control | |
// - Push button and transistor for backlight control | |
// - 220ohm resistor to make the backlight a bit darker |
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
class IncludeInterfacesModelMetadataProvider : DataAnnotationsModelMetadataProvider { | |
protected override IEnumerable<Attribute> FilterAttributes(Type containerType, PropertyDescriptor propertyDescriptor, IEnumerable<Attribute> attributes) { | |
var validationAttributesOnInterfaces = | |
from i in containerType.GetInterfaces() | |
from p in i.GetProperties() | |
where p.Name == propertyDescriptor.Name | |
from a in p.GetCustomAttributes(true).Cast<Attribute>() | |
where typeof(ValidationAttribute).IsAssignableFrom(a.GetType()) | |
select a; |
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
class ParallelHttpRequests | |
{ | |
static void Main() | |
{ | |
var count = 300; | |
var root = "http://files.kenegozi.com/temp/"; | |
ServicePointManager.DefaultConnectionLimit = 1000; |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using Xunit.Abstractions; | |
namespace MagicalUnicorns { | |
public class XunitConsoleForwarder : TextWriter { | |
private readonly ITestOutputHelper output; |
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 class GistsResolver { | |
public static string CreateContentForFeedFrom(string content) { | |
try { | |
return UnwrapGists(content, GetGist); | |
} | |
catch { | |
return content; | |
} | |
} |
OlderNewer