This file contains hidden or 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 Number | |
| { | |
| private int _n; | |
| public Number(int n) | |
| { | |
| _n = n; | |
| } | |
| public int Exponential() |
This file contains hidden or 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
| // Simple Data Container | |
| public class MyPoco | |
| { | |
| [Key] | |
| public int MyPocoId { get; set; } | |
| public string Status { get; set; } | |
| public DateTime Created { get; set; } | |
| } |
This file contains hidden or 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
| sudo apt-get update | |
| sudo apt-get install python-dev -y | |
| sudo apt-get install python-pip -y | |
| sudo apt-get install libevent-dev -y | |
| sudo apt-get install ruby1.9.1-full -y | |
| sudo apt-get install build-essential -y | |
| sudo apt-get install tcl8.5 -y | |
| sudo wget http://download.redis.io/releases/redis-2.6.16.tar.gz | |
| sudo tar xzf redis-2.6.16.tar.gz | |
| cd redis-2.6.16 |
This file contains hidden or 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 WhenICreateIdentifierFromRequest : WithSubjectAndResult<ScoreResourceIdentifierFactory, ScoreResourceIdentifier> | |
| { | |
| static CreateScoreResourceRequest _createScoreResourceRequest; | |
| Establish _context = () => The<IObjectHasher>().WhenToldTo(m => m.CreateHashFor(_createScoreResourceRequest)).Return("hash"); | |
| Because _of = () => Result = Subject.CreateIdentifierFromRequest(_createScoreResourceRequest); | |
| It _createsAHashFromTheObject = () => The<IObjectHasher>().WasToldTo(m => m.CreateHashFor(_createScoreResourceRequest)); |
This file contains hidden or 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 ScoreChecker | |
| { | |
| public IPlayer GetScoredPlayer(IPlayer player) | |
| { | |
| if (player.Score > 8) | |
| { | |
| return new HighScorePlayer(player); | |
| } | |
| if (player.Score > 2) |
This file contains hidden or 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
| namespace Domain | |
| { | |
| public interface IMyInterface | |
| { | |
| string MyProperty { get; set; } | |
| void PerformAction(); | |
| decimal MethodWithParameters(decimal a, int b); | |
| } |
This file contains hidden or 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
| MyProject.deploy.cmd | |
| /y /M:https://MyHostMachine:8172/MsDeploy.axd | |
| /u:MyUserName /p:MyPassword /A:Basic -allowUntrusted | |
| "-setParam:name='IIS Web Application Name',value='MyIISWebAppName'" |
This file contains hidden or 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
| app.directive('linkedSlider', function () { | |
| return { | |
| restrict: 'A', | |
| scope: { | |
| value: '=', | |
| link: '=', | |
| step: '@', | |
| min: '@', | |
| max: '@', | |
| condition: '&' |
This file contains hidden or 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 static class HttpContextBaseExtenstions | |
| { | |
| public static void SetSubdomainSafeCookie(this HttpContextBase context, string name, string value) | |
| { | |
| var domain = String.Empty; | |
| if (!context.Request.IsLocal) | |
| { | |
| var domainSegments = context.Request.Url.Host.Split('.'); | |
| domain = "." + String.Join(".", domainSegments.Skip(1)); |
This file contains hidden or 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
| AddMap<Pixel>(pixels => | |
| from p in pixels | |
| from tag in (p.Tags == null || !p.Tags.Any()) | |
| ? new[] {"_notags_"} | |
| : p.Tags | |
| select new GroupedResult | |
| { | |
| Tag = tag, | |
| PixelIds = new[] {p.Id}, | |
| Urls = new[] {(string) null} |