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
package main | |
import( | |
"html/template" | |
"io/ioutil" | |
"net/http" | |
"regexp" | |
) | |
type Page struct { |
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.Reactive.Linq; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Input; | |
namespace RxDragAndDrop { | |
public partial class MainWindow : Window { |
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 IEnumerable<string> GetPrimaryKeyNames<T>() { | |
ObjectSet<T> objCtx = (ctx as IObjectContextAdapter).ObjectContext.CreateObjectSet<T>(); | |
return objCtx.EntitySet.ElementType.KeyMembers.Select(k => k.Name); | |
} |
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
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
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.Reflection; | |
namespace Vkobel.ExtensionMethods { | |
public static class GenericPropertyMethods { | |
public static PropertyInfo GetProperty(this object obj, string name) { | |
return obj.GetType().GetProperty(name); | |
} |
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.Linq; | |
using System.Linq.Expressions; | |
namespace Data.GenericRepo { | |
public interface IRepository<T> : IDisposable where T : class { | |
T[] GetAll(); | |
IQueryable<T> Query(Expression<Func<T, bool>> predicate); |
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
// This sample will guide you through elements of the F# language. | |
// | |
// ******************************************************************************************************* | |
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click | |
// and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. | |
// ******************************************************************************************************* | |
// | |
// For more about F#, see: | |
// http://fsharp.net | |
// |
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
name := "Akka actors" | |
version := "1.0" | |
scalaVersion := "2.10.1" | |
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" | |
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.1.2" |
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
package akkaActors | |
import scala.concurrent.Await // enable awaiting a future | |
import scala.concurrent.duration._ // enable convert in to ms n.seconds | |
import scala.concurrent.Future // Future function | |
import scala.concurrent.ExecutionContext.Implicits.global // import global execution context (implicit way) | |
object futureTest extends App { | |
// Create and begin execution of the Future |
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
package akkaActors | |
import akka.actor.{ Actor, ActorSystem, Props, PoisonPill } | |
import akka.pattern.ask // enable the use of ? or ask that return a future from an actor | |
import akka.util.Timeout | |
import scala.concurrent.Await | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global // import global execution context (implicit way) | |
class HelloActor extends Actor { |