Skip to content

Instantly share code, notes, and snippets.

View kmorcinek's full-sized avatar

Krzysztof Morcinek kmorcinek

View GitHub Profile
@kmorcinek
kmorcinek / slownik
Created July 9, 2015 12:40
Slownik angielsko polski
second to last - przed ostatni
@kmorcinek
kmorcinek / race for the galaxy
Last active August 29, 2015 14:23
race for the galaxy strategies
https://linnaeus.wordpress.com/2009/01/20/rftg-fundamentals-1/
sprawdz jaka taktyke twoj przeciwnik ma (develop, military, etc). Jesli jest przewidywalny mozesz liczyc ze zagrac np Build dla ciebie.
Zbyt czesto gram karte () z minus jeden do Develop, gdy gram na Budowę Światów to nie jest mi to potrzebne.
Taktyka na wszystkie startowe.
Utracona ziemia taktyka:
@kmorcinek
kmorcinek / gist:46e02fbd2e29bfaf5bc5
Last active August 29, 2015 14:23
Autofixture stuff
http://stackoverflow.com/questions/10032535/can-autofixture-execute-a-delegate-at-object-creation-time?rq=1 :
fixture.Customize<MyClass>(c => c.Without(x => x.SomeWeirdText));
public static ObjectBuilder<User> BuildUser(this Fixture f)
{
return f.Build<User>().With(u => u.IsDeleted, false); // Probably you do not want code like this, explanation in above link.
}
http://megakemp.com/2013/04/16/general-purpose-customizations-with-autofixture/ :
CookbookAutoDataAttribute
from functools import reduce
http://www.artima.com/weblogs/viewpost.jsp?thread=98196
list("python")
https://docs.python.org/3/howto/functional.html
line_list = [' line 1\n', 'line 2 \n']
https://docs.python.org/3/tutorial/classes.html#class-objects
@kmorcinek
kmorcinek / Either.cs
Created June 12, 2015 09:38
Either<TSuccess, TFailure>
public class Either<TSuccess, TFailure>
{
private readonly TSuccess _success;
private readonly TFailure _failure;
private readonly bool _isSuccessful;
public bool Succeeded
{
get
{
public struct Option<T> : IEquatable<Option<T>>
{
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly Option<T> None = new Option<T>();
private readonly T _value;
private readonly bool _hasValue;
public T Value
{
get
private IEnumerable<string> GetAlphabetVariations()
{
char[] alphabet = "abcdefghijklmnopqrstuvwxyz".ToCharArray();
foreach (var first in alphabet)
{
foreach (var second in alphabet)
{
yield return "" + first + second;
}
@kmorcinek
kmorcinek / _vimrc
Created December 15, 2014 13:18
Vim configuration file _vimrc
set tabstop=4 shiftwidth=4 expandtab