View SshTunnel.cs
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
class SshTunnel : IDisposable | |
{ | |
private SshClient client; | |
private ForwardedPortLocal port; | |
private int localPort; | |
public SshTunnel (ConnectionInfo connectionInfo, uint remotePort) | |
{ | |
try { | |
client = new SshClient (connectionInfo); |
View gist:5575617
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
void Test() | |
{ | |
var ci = new ConnectionInfo ("remoteserver", "remoteuser", new PasswordAuthenticationMethod ("remoteuser", "password")); | |
var cs = new MySqlConnectionStringBuilder (); | |
cs.AllowBatch = true; | |
cs.Server = "127.0.0.1"; | |
cs.Database = "database"; | |
cs.UserID = "dbuser"; | |
cs.Password = "dbpassword"; | |
View RowVersionType.cs
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 RowVersionType : IUserVersionType | |
{ | |
public object Seed(ISessionImplementor session) | |
{ | |
return 0ul; | |
} | |
public object Next(object current, ISessionImplementor session) | |
{ | |
return current; |
View foo.il
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
.class interface private abstract auto ansi IBob | |
{ | |
.method public newslot abstract strict virtual | |
instance void Foo() cil managed | |
{ | |
} // end of method IBob::Foo | |
.method public newslot abstract strict virtual | |
instance void Bar() cil managed | |
{ |
View form1.cs
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 System.Threading; | |
using System.Windows.Forms; | |
namespace WindowsFormsApplication1 | |
{ | |
public partial class Form1 : Form | |
{ | |
[STAThread] | |
static void Main() |
View SortProject.linq
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
<Query Kind="Program" /> | |
static XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003"; | |
static XName ItemGroup = ns + "ItemGroup"; | |
static XName Reference = ns + "Reference"; | |
static XName ProjectReference = ns + "ProjectReference"; | |
static XName Condition = "Condition"; | |
static XName Include = "Include"; | |
static XName OutputType = ns + "OutputType"; | |
static XName Folder = ns + "Folder"; |
View InstantType.cs
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 System.Data; | |
using NHibernate; | |
using NHibernate.SqlTypes; | |
using NHibernate.UserTypes; | |
using NodaTime; | |
[Serializable] | |
public class InstantType : IUserType | |
{ |
View bower.json
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
{ | |
"private": true, | |
"name": "temp", | |
"main": "main.js", | |
"dependencies": { | |
"bootstrap": "3.3.6", | |
"bootstrap-switch": "3.3.2" | |
} | |
} |
View test.py
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
from docutils import nodes, core, io | |
from docutils.parsers.rst import Directive | |
def setup(app): | |
app.add_directive('test', TestDirective) | |
return {'version': '0.1'} | |
class TestDirective(Directive): | |
def run(self): | |
table = nodes.table(cols=2) |
View DevHost.cs
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 System.IO; | |
using System.Threading; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
class Program | |
{ | |
const string exe = "Server.exe"; | |
const string config = exe + ".config"; |
NewerOlder