Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| public class HawkAuthenticationHandler : AuthenticationHandler<HawkAuthenticationOptions> | |
| { | |
| private readonly ILogger logger; | |
| public HawkAuthenticationHandler(ILogger logger) | |
| { | |
| this.logger = logger; | |
| } | |
| protected override Task<AuthenticationTicket> AuthenticateCore() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| public class MyHub : Hub | |
| { | |
| public Task SendToQuery(string query, string value) | |
| { | |
| // Call the send to everybody that has the specified query string value | |
| return Clients.Query(c => c.QueryString[query] == value).send(); | |
| } | |
| } |
| package main | |
| // build +cgo | |
| import ( | |
| "fmt" | |
| "os" | |
| "unsafe" | |
| ) |
| [ | |
| { | |
| "code": "AAA", | |
| "lat": "-17.3595", | |
| "lon": "-145.494", | |
| "name": "Anaa Airport", | |
| "city": "Anaa", | |
| "state": "Tuamotu-Gambier", | |
| "country": "French Polynesia", |
| internal sealed class Configuration : DbMigrationsConfiguration<SpatialDemo.Models.SpatialDemoContext> | |
| { | |
| public Configuration() | |
| { | |
| AutomaticMigrationsEnabled = true; | |
| } | |
| protected override void Seed(SpatialDemo.Models.SpatialDemoContext context) | |
| { | |
| context.Locations.AddOrUpdate((x) => x.Name, |
| --This script attempts to migrate the users | |
| --from the old ASP.Net Membership tables | |
| --into the new SimpleMemberShip tables | |
| --The SimpleMembsership uses more secure password hashing, as such the old password hashes won't | |
| --work with the SimpleMembership tables. | |
| --As far as I can tell you have two options | |
| --1) Get your users to reset their passwords | |
| --2) Update your web.config to force SimpleMembership to use the old SHA1 format. See more details | |
| --here http://stackoverflow.com/questions/12236533/migrating-from-asp-net-membership-to-simplemembership-in-mvc4-rtm |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh