Skip to content

Instantly share code, notes, and snippets.

@alfeg
alfeg / OneToManyAttribute.cs
Last active June 15, 2017 06:52
SqliteLiteExtensions.cs
public class OneToManyAttribute : RelationAttribute
{
public string ForeignKey { get; }
public OneToManyAttribute(string foreignKey)
{
this.ForeignKey = foreignKey;
}
public override void SetProperty(PropertyInfo info)
@alfeg
alfeg / gist:878596
Created March 20, 2011 19:37
Topshelf configurator example
RunConfiguration cfg = RunnerConfigurator.New(
x =>
{
x.ConfigureService<SomeClass>(c =>
{
c.WhenStarted(s => s.BootHost());
c.WhenStopped(s => s.ShutDownHost());
c.WhenPaused(s => s.ShutDownHost());
c.WhenContinued(s => s.BootHost());
c.HowToBuildService(
@alfeg
alfeg / Wrappers.cs
Created February 24, 2017 15:51
Jerbrain.profile wrappers
public class DotMemoryProfile : IDisposable
{
public DotMemoryProfile()
{
if (MemoryProfiler.IsActive && MemoryProfiler.CanControlAllocations)
MemoryProfiler.EnableAllocations();
MemoryProfiler.Dump();
}
public void Dispose()
### Keybase proof
I hereby claim:
* I am alfeg on github.
* I am alfeg (https://keybase.io/alfeg) on keybase.
* I have a public key ASAos-cuH6vcwnT76XrUspk4nCNb4Wux4V5mQY_vQVemVgo
To claim this, I am signing this object:
find *.png -type f -exec curl -i -F filedata=@{} http://servername/image \;
@alfeg
alfeg / Program.cs
Last active March 30, 2016 16:00
String split - manual vs regex
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace BenchITSplit
{
class Program
Measure-Command { & C:\mybatfile.bat | Out-Default}
@alfeg
alfeg / expand.cs
Created October 15, 2013 12:41
This tool were used to convert files from tabs to spaces. This file can be compiled with mono
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace expand

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

#define WIN32_LEAN_AND_MEAN // just say no to MFC
#define INIT_GUID
#include "hge.h"
#include <hgesprite.h>
#include <hgefont.h>
#include <hgecolor.h>