Mounting shared folders between OSX and the docker container is tricky due to
the intermediate boot2docker VM. You can't use the usual docker -v
option as
the docker server knows nothing about the OSX filesystem - it can only mount
folders from the boot2docker filesystem. Fortunately, you can work around this
using SSHFS.
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 | |
#------------------------------------------------------------------------------ | |
# Name: sbtmkdirs | |
# Version: 1.5 | |
# Purpose: Create an SBT project directory structure with a few simple options. | |
# Author: Alvin Alexander, http://alvinalexander.com | |
# License: Creative Commons Attribution-ShareAlike 2.5 Generic | |
# http://creativecommons.org/licenses/by-sa/2.5/ | |
#------------------------------------------------------------------------------ |
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
-- This gist shows how we can use abilities to provide nicer syntax for any monad. | |
-- We can view abilities as "just" providing nicer syntax for working with the | |
-- free monad. | |
ability Monadic f where | |
eval : f a -> a | |
-- Here's a monad, encoded as a first-class value with | |
-- two polymorphic functions, `pure` and `bind` | |
type Monad f = Monad (forall a . a -> f a) (forall a b . f a -> (a -> f b) -> f b) |
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 | |
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html | |
cd /tmp | |
# install unzip just in case the user doesn't already have it. | |
if [[ `uname` = Linux ]]; then | |
sudo apt-get install unzip -y | |
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Clone just one branch | |
mkdir $BRANCH | |
cd $BRANCH | |
git init | |
git remote add -t $BRANCH -f origin $REMOTE_REPO | |
git checkout $BRANCH | |
// Aliases and stuff | |
git config --global user.name "Luis Uribe" |
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
import java.util.concurrent.atomic.AtomicReference | |
import java.util.concurrent.CountDownLatch | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext | |
import ExecutionContext.Implicits.global | |
object TxMapTest { | |
/* | |
* Example Usage | |
* We want to show two threads working with the same data source having both of their effects succeed |
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
trait EnvHacker { | |
/** | |
* Portable method for setting env vars on both *nix and Windows. | |
* @see http://stackoverflow.com/a/7201825/293064 | |
*/ | |
def setEnv(newEnv: Map[String, String]): Unit = { | |
try { | |
val processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment") | |
val theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment") | |
theEnvironmentField.setAccessible(true) |
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
//! Translation of | |
//! <http://www.cs.brandeis.edu/~storer/LunarLander/LunarLander/LunarLanderListing.jpg> | |
//! by Jim Storer from FOCAL to Rust. | |
use std::error::Error; | |
use std::io; | |
use std::io::prelude::*; | |
use std::marker::{Send, Sync}; | |
use std::process; | |
use std::str::FromStr; |
NewerOlder