Instead of running cmake in tree such as:
cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
import scala.util.Try | |
implicit class SeqTryExtension[T](seq: Seq[Try[T]]) { | |
def sequence: Try[Seq[T]] = | |
seq | |
.foldRight(Try(List.empty[T])) { | |
case (item, acc) => for { a <- acc; i<- item } yield i :: a | |
} | |
} |
#![allow(unused_parens)] | |
use anyhow::{Context,Result, anyhow}; | |
use clap::{arg, App, AppSettings}; | |
use std::ffi::OsStr; | |
fn main() -> Result<()> { | |
let matches = App::new("mkvm") | |
.about("Make virtual machines easily!") | |
.setting(AppSettings::SubcommandRequiredElseHelp) |
## /etc/network/interfaces | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
source /etc/network/interfaces.d/* | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback |
System Information | |
------------------- | |
Manufacturer: HP | |
Product Name: HP ENVY x360 Convertible 15-ee0xxx |
#!/bin/bash -eu | |
function linalg_matrix_dump { | |
local -n M=${1} | |
local -a data=(${M[data]}) | |
typeset -i rows=${M[rows]} | |
typeset -i cols=${M[cols]} | |
typeset -i i j | |
printf "%s:\n" ${1} | |
for ((i=0;i<rows;i++)) ; do |
#!/usr/bin/env python3 | |
import json | |
import requests | |
import argparse | |
import os | |
import sys | |
from git import Repo | |
## |
mod LinkedList { | |
type Link<T> = Option<Box<Node<T>>>; | |
struct Node<T> { | |
value: T, | |
next: Link<T>, | |
} | |
} | |
mod DoubleLinkedList { | |
use core::cell::RefCell; |
Instead of running cmake in tree such as:
cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
#!/bin/bash -ex | |
# This script creates a Salt installation inside a virtual environment so that | |
# a steteful infrastructure aiming customer A is absolutely oblivious of customer B. | |
# | |
# No changes are required on configuration files, so that you can be sure that | |
# whatever you keep in the source control is valid in production. All you have to do | |
# in production is copying the trees /etc/salt and /srv/salt from the source control | |
# to their glorified places /etc/salt and /srv/salt in production. | |
# |
def contents(ssh, files): | |
for file in files: | |
path = '{}/{}'.format(ssh, file) | |
yield open(path).read().replace("\n", "") | |
def keysFor(args): | |
ssh = '{}/.ssh'.format(os.environ['HOME']) | |
extensions = [ '.pub' ] | |
files = [f for f in os.listdir(ssh) if os.path.splitext(f)[1] in extensions] | |
keys = [k for k in contents(ssh, files) if k.split(' ')[2] in args] |