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
ALTER PROCEDURE [dbo].[TempGetStateItem3] | |
@id tSessionId, | |
@itemShort tSessionItemShort OUTPUT, | |
@locked bit OUTPUT, | |
@lockAge int OUTPUT, | |
@lockCookie int OUTPUT, | |
@actionFlags int OUTPUT | |
AS | |
DECLARE @textptr AS tTextPtr, @length AS int, @extendExpiration bit, @now AS datetime = GETUTCDATE(); |
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 static class DataReaderExtensions | |
{ | |
public static IEnumerable<T> Stream<T>(this IDbCommand command, Func<IDataRecord, T> converter) | |
{ | |
using (var reader = command.ExecuteReader(CommandBehavior.SingleResult)) | |
{ | |
while (reader.Read()) | |
yield return converter(reader); | |
} | |
} |
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
namespace DBI.Synchronization.Processing.ServiceManagement.Tasks | |
{ | |
internal static class ActivityExtensions | |
{ | |
internal static SMTask CreateChild(this long parentId, SMWorkOrderTaskTypeEnum type) | |
{ | |
var parent = SMTaskFactory.Factory.Fetch(parentId); | |
var child = parent.AddChildTask(); | |
child.TaskType = type; | |
child.Parent = parent; |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
namespace IrbClient | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Remote IRB - type some shit"); | |
using(new Context(2)) | |
using(var socket = new Socket(SocketType.REQ)) |
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 DataTranslator | |
{ | |
public static Func<IDataRecord, T> CreateTranslator<T>(IDataRecord record) | |
{ | |
Type targetType = typeof(T); | |
string cacheKey = string.Format("{0}-Translator", targetType); | |
var cachedTranslator = WebContextCache.GetItem<Func<IDataRecord, T>>(cacheKey); | |
if (cachedTranslator != null) |
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
/// <summary> | |
/// Resolves the timberline assembly. | |
/// </summary> | |
/// <param name="fileName">Name of the file.</param> | |
/// <returns></returns> | |
private static Assembly ResolveTimberlineAssembly(string fileName) | |
{ | |
var sharedDirectoryKey = Registry.LocalMachine.GetKey("SOFTWARE").GetKey("Timberline").GetKey("General"); | |
if (sharedDirectoryKey != null) |
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 HashProvider | |
{ | |
readonly SHA1Managed Hasher; | |
public HashProvider() | |
{ | |
this.Hasher = new SHA1Managed(); | |
} | |
public string GenerateHash(string data) | |
{ |
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
var fs = require('fs'), | |
sys = require('sys'); | |
fs.readdir('./', function(err, files) { | |
if (err) { | |
throw err; | |
} | |
sys.puts('callback from files ' + files.length); | |
return; | |
var portNum = 8000; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Autofac; | |
using Autofac.Builder; | |
using NServiceBus.ObjectBuilder.Autofac.Internal; | |
using Autofac.Core; | |
namespace NServiceBus.ObjectBuilder.Autofac | |
{ |