iohyve create ubuntuguest 8G
iohyve set ubuntuguest loader=grub-bhyve
iohyve set ubuntuguest os=debian
iohyve set ubuntuguest ram=512M
iohyve set ubuntuguest cpu=2
iohyve set ubuntuguest con=nmdm1
iohyve install ubuntuguest ubuntu-14.04.3-server-amd64.iso
This file contains hidden or 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
===> License MPL accepted by the user | |
===> Fetching all distfiles required by envconsul-0.5.0 for building | |
===> Extracting for envconsul-0.5.0 | |
=> SHA256 Checksum OK for envconsul_0.5.0_freebsd_amd64.tar.gz. | |
=========================================================================== | |
=======================<phase: patch-depends >============================ | |
=========================================================================== | |
=======================<phase: patch >============================ | |
===> Patching for envconsul-0.5.0 | |
=========================================================================== |
This file contains hidden or 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
// FindOne returns a single thread in the API | |
func (a *AppContext) FindOne(c *echo.Context) error { | |
id := c.P(0) | |
thread, err := a.ThreadStorage.FindOne(id) | |
if err != nil { | |
return c.JSON(http.StatusNotFound, nil) | |
} | |
return c.JSON(http.StatusOK, thread) | |
} |
This file contains hidden or 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
extern crate iron; | |
use iron::prelude::{Request}; | |
struct Resource { | |
is_available: fn(Request) -> bool | |
} | |
fn defaultResource() -> Resource { | |
Resource{is_available: |_| true} |
This file contains hidden or 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
extern crate iron; | |
use iron::prelude::{Request}; | |
struct Resource { | |
is_available: Box<Fn(Request) -> bool>, | |
} | |
fn defaultResource() -> Resource{ | |
Resource{is_available: Box::new(|_| true )} |
This file contains hidden or 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
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/sockets/%r@%h-%p | |
ControlPersist 600 |
This file contains hidden or 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
# rc.conf | |
# set up two bridge interfaces for iocage | |
cloned_interfaces="bridge0 bridge1" | |
# join interfaces, add the private interface to bridge0 | |
ifconfig_bridge0="inet 10.1.1.254/24 addm vtnet1 up" | |
# public network | |
ifconfig_vtnet0="inet 37.97.135.78 netmask 255.255.255.0" |
iohyve create ubuntuguest 8G
iohyve set ubuntuguest loader=grub-bhyve
iohyve set ubuntuguest os=debian
iohyve set ubuntuguest ram=512M
iohyve set ubuntuguest cpu=2
iohyve set ubuntuguest con=nmdm1
iohyve install ubuntuguest ubuntu-14.04.3-server-amd64.iso
- Drop in the console:
iohyve console ubuntuguest
This file contains hidden or 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
~/.e/omnisharp-roslyn (master✓) ./build.sh | |
dnvm is already installed in /Users/wunki/.dnx/dnvm, trying to update | |
=> Source string already in /Users/wunki/.bash_profile | |
Type 'source /Users/wunki/.dnx/dnvm/dnvm.sh' to start using dnvm | |
Downloading dnvm.sh from https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh | |
######################################################################## 100.0% | |
Default unstable feed (https://www.myget.org/F/aspnetvnext/api/v2) is being overridden by the value of the DNX_UNSTABLE_FEED variable (https://www.myget.org/F/aspnetcidev/api/v2). | |
dnx-mono.1.0.0-rc2-16444 already installed in /Users/wunki/.dnx | |
Adding /Users/wunki/.dnx/runtimes/dnx-mono.1.0.0-rc2-16444/bin to process PATH |
This file contains hidden or 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
use std::collections::HashMap; | |
type CharCount = HashMap<char, u16>; | |
fn word_to_hashmap(word: &str) -> CharCount { | |
let mut charcount = HashMap::new(); | |
for c in word.chars() { | |
let c = c.to_lowercase().next().unwrap(); | |
let count = charcount.entry(c).or_insert(0); | |
*count += 1; |