This gist has been upgraded to a blog post here.
| ###################### | |
| # | |
| # Monkey patch to ActiveRecord to prevent 'implicit' checkouts. Currently tested with Rails 4.0.8, prob | |
| # should work fine in Rails 4.1 too. | |
| # | |
| # If you create a thread yourself, if it uses ActiveRecord objects without | |
| # explicitly checking out a connection, one will still be checked out implicitly. | |
| # If it is never checked back in with `ActiveRecord::Base.clear_active_connections!`, | |
| # then it will be leaked. | |
| # |
| http://www.jerf.org/iri/post/2908 | |
| http://mwotton.github.com/hs_gbu/ | |
| http://reddit.com/r/haskell/comments/y6i7d/do_we_have_real_world_examples_of_where_static/ | |
| http://reddit.com/r/haskell/comments/12e3a0/the_good_the_bad_and_the_ugly_haskell_in/ | |
| http://blog.codersbase.com/2010/09/composability-laziness-testing-and.html | |
| https://www.fpcomplete.com/user/imalsogreg/functional-programming-elevator-pitch | |
| http://evincarofautumn.blogspot.com/2012/07/so-i-write-compilers-for-living-now.html | |
| http://www.reddit.com/r/haskell/comments/2gz7s1/please_point_me_at_an_eloquent_paper_or_post_on/ |
At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.
Over the past few months, I have been working on two Haskell services:
- A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
- A new service, which would interact with third-party components using standard data formats from the medical industry.
I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces
| The MIT License (MIT) | |
| Copyright (c) 2014 Tomas Kafka | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
DISCLAIMER: This could all quite plausibly brick your Chromebook, and I take no responsibility for any damage you might inflict on it or yourself. Follow along at your own risk.
Most Chromebooks can run some flavour of GNU/Linux using the Chrubuntu method, running off the kernel that comes with ChromeOS. I found, however, that the ChromeOS kernel didn’t play well with recent X.org versions, and would refuse to recover from suspend, and not deal very well at all with having an external screen attached to it.
I also wanted to replace ChromeOS entirely with Arch on my Chromebook, because only 16 gigabytes of eMMC isn’t very convenient for dual booting. To accomplish this, I needed an external installation medium.
First of all, you’ll need to get your Chromebook into developer mode if you haven’t already. This is model specific, although for most recent models holding the Escape and Reload keys while booting should do the trick. If not, ask Google.
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| import Control.Monad.IO.Class | |
| import Control.Monad.Trans.Class | |
| import Prelude hiding (log) | |
| -------------------------------------------------------------------------------- | |
| -- The API for cloud files. | |
| class Monad m => MonadCloud m where | |
| saveFile :: Path -> Bytes -> m () |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm