😶🌫️
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
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
{ | |
"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
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
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
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
let get = macro { | |
rule { $path:lit $do $res:lit } => { | |
app.get($path, function (req, res) { | |
res.$do($res); | |
}); | |
} | |
rule { $path:lit $do:ident($sc:lit) $res:lit } => { | |
app.get($path, function (req, res) { | |
res.$do($res); | |
res.status($sc); |
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
var express = require('express'); | |
var app = express(); | |
get '/404' send(404) 'Not Found' | |
get '/foo' with (req, res) { | |
res.json({ foo: 'bar' }); | |
} |
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
var request = require('requst'); //npm install request | |
var assert = require('assert'); //build in to Node.js | |
request('http://httpstat.us/200', function (err, res, body) { | |
assert.equal(res.statusCode, 200, 'Expected a 200 response'); | |
}); |
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
var dateItems = [].slice.call(document.querySelectorAll('.log-date span')); | |
var dates = dateItems.map(function (item) { | |
return { span: item, date: Date.parse(item.getAttribute('title')) }; | |
}).map(function (item, index, arr) { | |
var next = arr[index + 1] || item; | |
return { | |
span: item.span, | |
date: item.date, | |
next: next |