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
{ | |
"Attribute using recommended pattern": { | |
"prefix": "attribute", | |
"body": [ | |
"[System.AttributeUsage(System.AttributeTargets.${All}, Inherited = ${false}, AllowMultiple = ${true})]", | |
"sealed class ${My}Attribute : System.Attribute", | |
"{", | |
" // See the attribute guidelines at", | |
" // http://go.microsoft.com/fwlink/?LinkId=85236", |
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
on run {input, parameters} | |
tell application "Finder" | |
set dir_path to "\"" & (POSIX path of (input as string)) & "\"" | |
-- display dialog dir_path | |
end tell | |
CD_to(dir_path) | |
end run | |
on CD_to(theDir) | |
tell application "iTerm" |
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 TestFixture1 { | |
[Fact] | |
public async Task FactMethodName1() { | |
var sut = A.Fake<IAsyncClass>(); | |
await sut.GetAsync(new Input{Test = "test"}); | |
A.CallTo(() => sut.GetAsync(A<Input>.That.Matches(_ => _.Test == "test"))).MustHaveHappened(); | |
} |
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 static class MessageTypeScanner { | |
public static IEnumerable<Type> ScanAllEventHandlers(Assembly assembly) { | |
var handlers = from type in assembly.GetTypes() | |
where type.GetInterfaces().Any(IsEventHandler) | |
select type; | |
return handlers. | |
SelectMany(handler => handler.GetInterfaces().Where(IsEventHandler).Select(@interface => @interface.GetGenericArguments()[0])). | |
Distinct(); | |
} |
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 allowedItemPromises = items.map(function (item) { | |
return $.Deferred(function (dfd) { | |
promiseThatChecksSomethingServerside.done(function (filterPasses) { | |
dfd.resolve(filterPasses ? [item] : []); | |
}); | |
}).promise(); | |
}); | |
$.when.apply($, allowedItemPromises).then(function () { | |
var result = [].slice.call(arguments); |
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
#!/bin/sh | |
branchName=$(git branch | grep '*' | sed 's/* //') | |
if [ $(echo "$branchName" | grep -E "^[a-z]{3}[0-9]*$") ]; then | |
uppercaseBranchName=`echo $branchName | awk '{print toupper($0)}'`; | |
length=${#uppercaseBranchName}; | |
issueNumber=${uppercaseBranchName:0:3}-${uppercaseBranchName:3:length}; | |
sed -i.bak -e "1s/^/$issueNumber /" $1 | |
else |