I wrote this four years ago, so instead use this command:
$ docker rmi $(docker images -q -f dangling=true)
Properties { | |
$Build_dir = Split-Path $psake.build_script_file | |
$Packages_dir = Join-Path $build_dir 'Packages' | |
$MsDeploy_dir = Join-Path $env:ProgramFiles 'IIS\Microsoft Web Deploy' | |
$SiteName = 'www.example.com' | |
$Package = "$SiteName.zip" | |
$Dest = 'hosting.com' | |
$UserName = 'IIS User Name' | |
$Pwd = 'Secret Password' |
//Stupid "Schrodinger sort (cat not involved!)" based on http://dis.4chan.org/read/prog/1295544154 - great antipattern | |
static void Main(string[] args) | |
{ | |
int[] xs = new[] { 5, 3, 6, 3, 6, 3, 1, 4, 7}; | |
var results = new ConcurrentQueue<int>(); | |
Console.WriteLine("Sorted:"); | |
Parallel.ForEach(xs, n => | |
{ | |
Thread.SpinWait(n); //Thread.Sleep(n); |
// This is a hacky sample (that works for me) of alternative way to use Lokad-codeDSL | |
// or any similar way of generating message contracts on-the-fly. Original approach was | |
// with using T4 template, that would rebuild cs files from DSL representation, whenever | |
// we hit Ctrl-S. | |
// This approach works almost exactly like this (Ctrl-S to rebuild), but does not require VS | |
// to run or does not require unloading VS to change the underlying generator code. | |
// in fact it is extremely boring. Lolcats from MightyMoose could be used to improve the situation, though. | |
// any takers? :) |
# Committing changes to a repo via the Github API is not entirely trivial. | |
# The five-step process is outlined here: | |
# http://developer.github.com/v3/git/ | |
# | |
# Matt Swanson wrote a blog post translating the above steps into actual API calls: | |
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html | |
# | |
# I was not able to find sample code for actually doing this in Ruby, | |
# either via the HTTP API or any of the gems that wrap the API. | |
# So in the hopes it will help others, here is a simple function to |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public interface Maybe<T> { } | |
public class Nothing<T> : Maybe<T> { } | |
public class Just<T> : Maybe<T> { | |
public T Value { get; private set; } |
import mesosphere.mesos.util.FrameworkInfo | |
import org.apache.mesos.MesosSchedulerDriver | |
/** | |
* @author Tobi Knaup | |
*/ | |
object Main extends App { |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
import com.typesafe.config.ConfigFactory | |
import scala.util.Properties | |
class MyConfig(fileNameOption: Option[String] = None) { | |
val config = fileNameOption.fold( | |
ifEmpty = ConfigFactory.load() )( | |
file => ConfigFactory.load(file) ) | |
def envOrElseConfig(name: String): String = { |
A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.
There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.
Libraries are sorted by github popularity.