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
source.MyEvent += | |
delegate(object s, EventArgs e) | |
{ | |
DoSomething(); | |
}; |
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
source.MyEvent += | |
delegate(object s, EventArgs e) | |
{ | |
DoSomething(); | |
}; |
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
task PrepareClickOnce { | |
write-host 'Add mage to our path' | |
$env:path += ";C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" | |
write-host "Preparing install directory" | |
$installersRoot = '..\installers\app' | |
if (test-path $installersRoot) { | |
Write-Host "Cleaning installers root" | |
rm -r -force $installersRoot > $null |
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
find . -type d -maxdepth 1 -exec sh -c '(cd {} && git branch -l | grep $1 && pwd)' ';' |
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 dataSource = new SqlServerDataSource | |
{ | |
ConnectionString = "connection-string" | |
}; | |
var procedure = new StoredProcedure("SomeStoredProcedureName"); | |
procedure.AddInput("parameter", "value"); | |
dataSource.Execute(procedure, t => | |
{ |
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 defaultFormatters = GlobalConfiguration.Configuration.Formatters | |
.Where(f => f.SupportedMediaTypes | |
.Any(m => m.MediaType.ToString(CultureInfo.InvariantCulture) == "application/xml" | |
|| m.MediaType.ToString(CultureInfo.InvariantCulture) == "text/xml")) | |
.ToList(); | |
foreach (var match in defaultFormatters) | |
{ | |
GlobalConfiguration.Configuration.Formatters.Remove(match); | |
} |
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 Castle.Facilities.TypedFactory; | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
namespace castlething | |
{ | |
public class Program | |
{ | |
public interface IMathService |
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
/// <summary> | |
/// Repository interface | |
/// </summary> | |
public interface IMongoRepository | |
{ | |
/// <summary> | |
/// Indicates whether or not the repository can connect to the underlying | |
/// mongo instance | |
/// </summary> | |
bool CanConnect { get; } |
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 UpdateJobIsPinned : IUpdate<Job, bool> | |
{ | |
public UpdateJobIsPinned(string id, bool isPinned) | |
{ | |
Id = id; | |
IsPinned = isPinned; | |
} | |
public string Id { get; private set; } |
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
$('.button').each(function () { | |
var location = $(this).attr('href'); | |
$(this).click(function (e) { | |
var image = $('<img/>'); | |
image.error(function () { | |
window.location = location; | |
}).load(function () { | |
window.location = location; | |
}).attr('src', location); |
OlderNewer