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 TEntity GetEntityByPrimaryKey(object pkKey, params object[] pkKeys) | |
{ | |
List<object> primaryKeys = new List<object>(); | |
primaryKeys.Add(pkKey); | |
primaryKeys.AddRange(pkKeys); | |
TEntity entity = null; | |
Type entityType = typeof(TEntity); | |
using (DataContext dataContext = new DataContext(this._DbConnection)) |
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 WcfDataTable : DataTable, IXmlSerializable | |
{ | |
private string _ServerName; | |
public WcfDataTable() | |
: base() | |
{ } | |
public WcfDataTable(string tableName) | |
: base(tableName) |
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 WindowHandleInfo | |
{ | |
private delegate bool EnumWindowProc(IntPtr hwnd, IntPtr lParam); | |
[DllImport("user32")] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam); | |
private IntPtr _MainHandle; | |
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
#!/bin/bash | |
usage () | |
{ | |
cat <<UsageHERE | |
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host | |
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT | |
or boot2docker-fwd -d RULE_NAME | |
or boot2docker-fwd -l | |
or boot2docker-fwd -A |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"sync" | |
"time" | |
) |
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
exec 1<&- | |
exec 2<&- | |
exec 1<>/tmp/container-hook.log | |
exec 2>&1 |
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
CapsLock => No Action | |
Option => Command | |
Command => Option | |
Control => Control |
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
package main | |
import ( | |
"os" | |
"syscall" | |
"time" | |
) | |
func pipe(path string) (*os.File, *os.File, error) { | |
syscall.ForkLock.RLock() |
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
// main.go | |
package main | |
import "fmt" | |
type User struct { | |
FirstName string | |
LastName string | |
} |
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
#cloud-config | |
#http://www.jimmycuadra.com/posts/securing-coreos-with-iptables/ | |
coreos: | |
units: | |
- name: iptables-restore.service | |
enable: true | |
write_files: | |
- path: /var/lib/iptables/rules-save | |
permissions: 0644 | |
owner: root:root |
OlderNewer