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
robert [9:41 AM] | |
argh i hate how csharp handles | |
```return x | |
&& y | |
&& z == a ? b : c; | |
``` | |
[9:41 AM] | |
you need `( )` around that last one after the `&&` (edited) |
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
"The Expense" tv series built on the books |
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
open System | |
let stringifyMe myInt = | |
myInt.ToString() | |
printf stringifyMe String.length ("👨👩👧👦") |
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
package main | |
import "fmt" | |
const ( | |
tomato, apple int = iota + 1, iota + 2 | |
orange, chevy | |
ford, _ | |
) |
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
function uptime() { | |
(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Format-Table | |
} |
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
<system.serviceModel> | |
<behaviors> | |
<endpointBehaviors> | |
<behavior> | |
<WebHttpBehavior /> | |
</behavior> | |
</endpointBehaviors> | |
</behaviors> | |
</system.serviceModel> |
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
It's not the same because opinionation is on a sliding scale orthogonal to abstraction. Boiled down -- Opinions == expression to satisfy a goal, Abstraction -- hiding something by making its interface more generic. I think a good example of these concepts is the OSI model - different protocols exist at each layer (level of abstraction), but they have varying degrees of opinions (leave more or less up to you, the programmer) |
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 EasyEnum<T> : IEnumerable<object> | |
{ | |
private List<object> _values; | |
private Type underlyingType; | |
public EasyEnum() | |
{ | |
if (typeof(T).IsSubclassOf(typeof(Enum))) | |
{ | |
this.underlyingType = Enum.GetUnderlyingType(typeof(T)); |
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
$rootDriveAsString = Get-PSDrive | |
| Where-Object { $_.Provider.Name -eq "FileSystem" } | |
| Where-Object { (Get-WmiObject Win32_OperatingSystem).SystemDirectory.Contains($_.Root) -and $_.Root -ne "" } |
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
private DateTime? FloorDatetimeToDayPrecision(DateTime? inDatetime) | |
{ | |
if (inDatetime.HasValue && inDatetime.Value.TimeOfDay > TimeSpan.MinValue) | |
{ | |
var oldDatetime = inDatetime.Value; | |
return new DateTime(oldDatetime.Year, oldDatetime.Month, oldDatetime.Day, 0, 0, 0); | |
} | |
else | |
{ | |
return inDatetime; |