😶🌫️
This file contains 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 Person(name) { | |
this.name = name; | |
return new Proxy(this, { | |
set: function (target, property, val) { | |
var currentType = typeof target[property]; | |
var newType = typeof val; | |
if (property in target && currentType !== newType) { | |
throw new Error('Property ' + property + ' must be a ' + currentType); | |
} | |
target[property] = val; |
This file contains 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
using System; | |
using System.Threading; | |
using System.Windows.Forms; | |
namespace AltTabby | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains 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
operator (in) 10 left { $l, $r} => #{ Array.isArray($r) ? !~$r.indexOf($l) : !!$r[$l] } | |
var x = 7 in [1,2,3,4]; |
This file contains 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
git ss | grep "^UU" | sed 's/UU//' | while read i; do git checkout --theirs $i && git add $i; done | |
# change `--theirs` to `--ours` to take your own version |
This file contains 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
{ | |
"cmd": ["sjs", "$file", "-o", "$file_base_name.js"], | |
/*"file_regex": "", TODO: Work this out*/ | |
"selector": "source.sjs" | |
} | |
//ref: http://docs.sublimetext.info/en/latest/file_processing/build_systems.html |
This file contains 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 AuthenticationController : ApiController { | |
public void SomethingThatIsPublic(Something something) { /* not important */ } | |
public HttpResponseMessage Post(LoginModel model) { | |
//do login | |
//return | |
} | |
} |
This file contains 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
Get-ChildItem -Filter *.csproj -Recurse | | |
Select-Object -Property FullName,@{N="Xml"; E = { | |
Select-Xml -Path $_.FullName -XPath //b:Reference -Namespace @{b='http://schemas.microsoft.com/developer/msbuild/2003'} | | |
Select-Object -ExpandProperty Node | | |
Select-Object -Property Include, HintPath | | |
Where-Object { $_.HintPath -ne $null } | | |
Where-Object { $_.Include -eq "My.Assembly.Name" } | |
} } | | |
Where-Object { $_.Xml -ne $null } | | |
Out-GridView |
This file contains 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
CmsPropertyTypes | |
.GroupBy(pt => pt.ContentTypeId) | |
.Join(CmsDocumentTypes, x => x.Key, x => x.ContentTypeNodeId, (pts, dt) => new { | |
Property = pts, | |
DocumentType = dt | |
}) | |
.Join(UmbracoNodes, x => x.DocumentType.ContentTypeNodeId, x => x.Id, (x, n) => new { | |
x, | |
n.Text | |
}) |
This file contains 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
(from dt in CmsDocumentTypes | |
join n in UmbracoNodes on dt.ContentTypeNodeId equals n.Id | |
select new { | |
n.Id, | |
n.Text, | |
Docs = CmsContents.Where(c => c.ContentType == n.Id).Where(c => !c.Node.Trashed).Count(), | |
IsNested = n.ParentID != -1 | |
}) | |
.Distinct() | |
.GroupBy(x => x.Docs) |
This file contains 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
macro null_helper { | |
rule { ($processed ...) ($rest) } => { | |
$processed (.) ... . $rest | |
} | |
rule { ($processed ...) ($rest_head $rest ...) } => { | |
$processed (.) ... . $rest_head | |
&& null_helper ($processed ... $rest_head) ($rest ...) | |
} | |
} | |