Skip to content

Instantly share code, notes, and snippets.

@jahands
jahands / example_docs.json
Last active August 29, 2015 14:14
MongoDB Example Documents
{
"clients": [
{
"_id": "...",
"name": [
{
"first": "...",
"last": "...",
"middle": "...",
"other": [
@jahands
jahands / gist:72c19c12f2b490cdc837
Created February 26, 2015 05:14
EF Code-first IsUnique()
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Infrastructure.Annotations;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Imflow.Data
@jahands
jahands / gist:fd7ecd4a5ac779fa515c
Created February 26, 2015 23:51
Find all permutations with separate charset for each index
using System;
using System.Collections.Generic;
using System.Linq;
namespace PasswordTableTest
{
static class Program
{
static void Main(string[] args)
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Imflow.Utilities;
public class User : IPerson, ICredential
{ ... }
public class UserConfiguration : EntityTypeConfiguration
{
// Add already made configurations for IPerson and ICredential
ConfigureAnyType(this, typeof(User));
}
public static void ConfigureAnyType(EntityTypeConfiguration<Type> entity, Type modelType)
{
delegate configureDelegates;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Imflow.Utilities;
@jahands
jahands / mvvmlightset.cs
Created May 28, 2015 19:44
MVVM Light additional ObservableObject.Set() methods to allow arbitrary backing fields & easier object wrapping.
// This would allow using properties as the backing fields.
// Useful when making models which wrap an object and use an
// instance of that object for the backing field, as
// shown in the example below.
// Usage:
public class PersonViewModel : EasyObservableObject
{
private Person p = new Person();
public string FirstName
Function ArchiveFiles
{
# Params.
param(
[string]$Source,
[int]$Depth,
[string]$Dest,
[switch]$DeleteOriginal,
[switch]$FoldersOnly,
[switch]$SkipFileList
@jahands
jahands / sad.go
Created August 14, 2015 21:11
Go code for recursively getting files
package main
import (
"fmt"
"io/ioutil"
"strconv"
"sync"
"time"
)
@jahands
jahands / golang-resources.md
Last active September 2, 2015 16:48
Go (golang) Resources

Source: Go blog

A couple videos which helped me understand Go's background.

  • Go, Open Source, Community — Russ Cox (video) (text)
  • How Go Was Made — Andrew Gerrand (video) (slides)
  • The Roots of Go — Baishampayan Ghose (video) (slides)
  • The Evolution of Go — Robert Griesemer (video) (slides)

Other good Go resources: