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 FluentAssertions; | |
using Xunit; | |
namespace FooTests | |
{ | |
/// <summary> | |
/// https://xunit.github.io/docs/shared-context.html#collection-fixture | |
/// | |
/// Important note: Fixtures can be shared across assemblies, but collection definitions must | |
/// be in the same assembly as the test that uses them. |
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 | |
docker run \ | |
--rm \ | |
-it \ | |
-e LOCAL_USER_ID=`id -u $USER` \ | |
-p 4001:4001 \ | |
-v ${PWD}/share/octopress:/octopress \ | |
-v ${PWD}/post-install.sh:/home/user/post-install.sh \ | |
draptik/octopress:0.2 \ |
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
[push] | |
default = simple | |
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
ec = config --global -e | |
s = status | |
co = checkout | |
cob = checkout -b | |
up = pull --rebase | |
cm = !git add -A && git commit -m |
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 | |
gem install bundler execjs | |
cd /octopress | |
# Important: use `--path...`! | |
bundle install --path $HOME/.gem |
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
[HttpPost] | |
public HttpResponseMessage CreateCustomer(string name, string billingInfo) | |
{ | |
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo); | |
Result<CustomerName> customerNameResult = CustomerName.Create(name); | |
return Result.Combine(billingInfoResult, customerNameResult) | |
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value)) | |
.OnSuccess(() => new Customer(customerNameResult.Value)) | |
.OnSuccess( |
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
# pacman -S python-virtualenvwrapper | |
$ echo 'WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc | |
$ . ~/.bashrc | |
$ mkdir -p $WORKON_HOME | |
$ echo 'source /usr/bin/virtualenvwrapper.sh' > ~/.bashrc | |
$ . ~/.bashrc | |
$ mkvirtualenv -p python2.7 --distribute blog_env |
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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
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
var expect = require('chai').expect; | |
var d3 = require('d3'); | |
describe('app', function () { | |
var myData = [ | |
{ countryCode: 'DE', areaName: 'DE1', speciesName: 's1', totalScore: 1000 }, | |
{ countryCode: 'DE', areaName: 'DE1', speciesName: 's2', totalScore: 2000 }, | |
{ countryCode: 'DE', areaName: 'DE1', speciesName: 's3', totalScore: 3000 }, | |
{ countryCode: 'DE', areaName: 'DE2', speciesName: 's1', totalScore: 1000 }, |
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 | |
# | |
# Setup: | |
# | |
# +--------+ +-----+ | |
# | MyData | | HDD | | |
# | | (1) rdiff-backup | | | |
# | | ------------------> | | | |
# | | | | +-----+ | |
# | | (2) duplicity | | (3) rsync | USB | |
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
# Idea from: | |
# | |
# https://bbs.archlinux.org/viewtopic.php?pid=1068202 | |
# Colors https://wiki.archlinux.org/index.php/Color_Bash_Prompt | |
# Note: We require escape '\[' and '\]' around the ansi escapes | |
# (i.e. '\e[0m')! Otherwise the shell does not know that the ansi | |
# escapes should be excluded from the line wrapping calculation. | |
# | |
# See |