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
c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe fix_crlf.cs | |
fix_crlf.exe |
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 Manos; | |
using System; | |
using System.IO; | |
public class RandomAd : ManosApp { | |
public RandomAd () { | |
var ads = Directory.GetFiles(".", "*.gif"); | |
var random = new Random(); | |
Route ("/", ctx=> { |
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
// adding GeneralView class with IsCurrentUserAdmin bool field, | |
// Derive LayoutView from GeneralView | |
// Derive HomepageView and PostPageView from LayoutView | |
public ActionResult ViewPost(string permalink) { | |
var post = magic.GetPostBy(permalink); | |
var view= new PostView {Post=post}; | |
GetLayoutData(view); | |
view.Related = magic.GetContentRelatedTo(post); | |
Return View(view); |
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
interface IDoWork { | |
void DoThis(); | |
string WhatsThat(int that); | |
} | |
class DoWork : IDoWork { | |
public void DoThis() { | |
Log.Action("DoWork.DoThis", () => DoThisImpl() ); | |
} |
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 = { | |
doThis : function() { console.log('doThis'); }, | |
whatIsThat : function(i) { console.log('whatIsThis'); return 'that is ' + i; }, | |
name : 'I am x' | |
}; | |
for (methodName in x) { | |
var method = x[methodName]; | |
if (typeof method !== 'function') continue; | |
x[methodName] = (function(method, methodName) { |
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
public class GistsResolver { | |
public static string CreateContentForFeedFrom(string content) { | |
try { | |
return UnwrapGists(content, GetGist); | |
} | |
catch { | |
return content; | |
} | |
} |
OlderNewer