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 RedisCommand | |
{ | |
static byte[] GenerateCommand(byte[][] arguments) | |
{ | |
using (var stream = new MemoryStream()) | |
{ | |
var request = CreateIndicator('*', arguments.Length); | |
stream.Write(request, 0, request.Length); | |
stream.WriteNewLine(); |
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 CooperativeQueue<TMessage> | |
where TMessage : class, IQueueMessage | |
{ | |
private readonly Queue<TMessage> internalQueue; | |
private readonly ManualResetEventSlim manualReset; | |
private bool open; | |
public CooperativeQueue() | |
{ | |
internalQueue = new Queue<TMessage>(); |
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 sealed class CsvReader : IDisposable | |
{ | |
private const char DefaultFieldChar = ','; | |
private const char DefaultQuoteChar = '"'; | |
private const char DefaultEscapeChar = '\\'; | |
private readonly List<CsvLine> collection; | |
private readonly StringBuilder buffer; | |
private readonly Stream stream; | |
private readonly StreamReader 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using StructureMap; | |
namespace Task.Services.Service | |
{ | |
public class Controller |
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 RabbitMQ.Client | |
public class CooperativeConsumer : IBasicConsumer | |
{ | |
private readonly IModel channel; | |
private readonly CooperativeQueue<IQueueMessage> queue; | |
public IModel Model | |
{ | |
get { return channel; } |
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 RabbitMQ.Client; | |
using RabbitMQ.Client.Exceptions; | |
public class MessageQueueFactory : IMessageQueueFactory | |
{ | |
private readonly ConnectionFactory factory; | |
private IConnection connection; | |
public bool IsOpen | |
{ |
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 bash | |
## add redis to the package list | |
cat <<BAM >> /etc/apt/sources.list.d/dotdeb.org.list | |
# /etc/apt/sources.lsit.d/dotdeb.org.list | |
deb http://packages.dotdeb.org squeeze all | |
deb-src http://packages.dotdeb.org squeeze all | |
BAM | |
## import redis public key to package keys |
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
# | |
# ~/.bashrc | |
# | |
export LANG=en_US.UTF-8 | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
alias ls='ls --color=auto -F' | |
alias grep='grep --color=auto' |
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
'use strict'; | |
import React from 'react'; | |
import ReactDom from 'react-dom'; | |
import { UserService, ExampleService } from './service'; | |
import Promise from 'bluebird'; | |
import assign from 'object-assign'; | |
class ComponentWrapper { |
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 path = require('path'); | |
var webpack = require('webpack'); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'./src/index' | |
], | |
output: { | |
path: path.join(__dirname, 'public'), |
OlderNewer