start new:
tmux
start new with session name:
tmux new -s myname
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
< | |
%3C | |
< | |
< | |
< | |
< | |
< | |
< | |
< | |
< |
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import System.Random | |
import Text.Printf | |
-- Forks | |
type Fork = TMVar Int | |
newFork :: Int -> IO Fork |
this is a sample of output: | |
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1 | |
------------------------------------------------------------ | |
Server listening on UDP port 5001 | |
Binding to local address 226.94.1.1 | |
Joining multicast group 226.94.1.1 | |
Receiving 1470 byte datagrams | |
UDP buffer size: 122 KByte (default) | |
------------------------------------------------------------ |
me: | |
@true | |
a: | |
@true | |
sandwich: | |
@[ "$$(id -u)" -eq 0 ] && echo "Okay." || echo "What? Make it yourself." | |
.PHONY: me a sandwich |
use std::str::FromStr; | |
#[derive(Debug)] | |
enum Version { Version1, Version2 } | |
#[derive(Debug)] | |
enum ParseError { InvalidSyntax, UnsupportedVersion } | |
fn parse_version(line: String) -> Result<Version, ParseError> { | |
let mut split = line.split("="); |
use std::str::FromStr; | |
#[derive(Debug)] | |
enum Version { Version1, Version2 } | |
#[derive(Debug)] | |
enum ParseError { InvalidSyntax, UnsupportedVersion } | |
struct NameValue { | |
name: String, |
use std::fmt::Debug; | |
fn takes_two_things<T: Debug, U: Debug>(x: T, y: U) { | |
println!("{:?} {:?}", x, y); | |
} | |
fn main() { | |
takes_two_things(3, "ok"); | |
takes_two_things(3, 2); // fine if the same | |
} |
#[derive(Clone, Copy)] | |
struct Comp; | |
struct USB; | |
struct Card; | |
impl USB { | |
fn get_version(&self) -> Option<f64> { | |
Some(1.2) | |
} | |
} |