using System.Linq.Expressions; | |
namespace Microsoft.EntityFrameworkCore | |
{ | |
public static class IQueryableExtensions | |
{ | |
public static IQueryable<TQuery> In<TKey, TQuery>( | |
this IQueryable<TQuery> queryable, | |
IEnumerable<TKey> values, | |
Expression<Func<TQuery, TKey>> keySelector) |
function Convert-Path { | |
<# | |
.SYNOPSIS | |
A replacement for convert-path that returns a normalized form of paths, even on Windows file system. | |
.DESCRIPTION | |
This replacement for Convert-Path ensures it's returning the actual case for PowerShell paths, and normalizes them so that folders always include a trailing slash, allowing comparisons of paths to do so correctly. | |
When working with environment variables and paths, we want to remove duplicates, | |
but uniqueness tests are case-sensitive, | |
while the Windows FileSystem (and thus, the built-in Convert-Path) is not. |
<Query Kind="Program"> | |
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference> | |
<Namespace>Microsoft.Diagnostics.Runtime</Namespace> | |
<Namespace>System</Namespace> | |
<Namespace>System.IO</Namespace> | |
<Namespace>System.Linq</Namespace> | |
<Namespace>System.Text</Namespace> | |
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace> | |
</Query> |
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
import UIKit | |
// How to make singleton classes in Swift: http://stackoverflow.com/questions/24024549/dispatch-once-singleton-model-in-swift | |
// Basically using global constants is the most easy and safe way to go | |
class APIClient: NSObject { | |
let functionSessionManager:AFHTTPSessionManager | |
class var sharedInstance:APIClient { |
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 |