Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
version: "3.8" | |
services: | |
chrome: | |
network_mode: "host" | |
image: jess/chrome | |
environment: | |
DISPLAY: 'unix:0' | |
volumes: | |
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket |
.block-children { | |
border-left-width: var(--ls-block-bullet-threading-width); | |
} | |
.block-content-wrapper { | |
position: relative; | |
} | |
.bullet-container { | |
height: 14px !important; |
#![allow(dead_code)] | |
// playground: https://gist.github.com/rust-play/6d697a29901d4b82cc8b184526d4b8f1 | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { | |
for start_idx in 0..(w.chars().count()) { | |
let slice: &str = &w[start_idx..]; | |
let w = String::from(slice); |
#![allow(dead_code)] | |
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bda017580640d3b70ea211bec7e9038b | |
// Task: sorted postfixes for given list of strings | |
// Example: bcd -> bcd,cd,d | |
// Example: abc,bcd,xyz -> abc,bc,bcd,c,cd,d,xyz,yz,z | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { |
/* | |
/* Theme custom css start | |
/* https://raw.githack.com/dracula/logseq/master/custom.css | |
*/ | |
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"); | |
:root { | |
--background: #282a36; | |
--light-background: #343746; |
FROM archlinux:20200205 AS arch-ghc-build-env | |
RUN pacman -Syu --noconfirm | |
RUN pacman -S --noconfirm git base-devel go python python-sphinx libedit numactl exa | |
# use all possible cores for subsequent package builds | |
RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf | |
# don't compress the packages built here | |
RUN sed -i "s,PKGEXT='.pkg.tar.xz',PKGEXT='.pkg.tar',g" /etc/makepkg.conf | |
# set up the packager user |
use std::str; | |
fn main() { | |
// -- FROM: vec of chars -- | |
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
// to String | |
let string1: String = src1.iter().collect::<String>(); | |
// to str | |
let str1: &str = &src1.iter().collect::<String>(); | |
// to vec of byte |
use std::time::{ Instant, Duration }; | |
fn benchmark<F: FnOnce()>(f: F) { | |
let t0 = Instant::now(); | |
f(); | |
let t1 = Instant::now(); | |
let dt = t1 - t0; | |
println!("{}", dt.as_millis()); | |
} |
function dockershell() { | |
docker run --rm -i -t --entrypoint=/bin/bash "$@" | |
} | |
function dockershellsh() { | |
docker run --rm -i -t --entrypoint=/bin/sh "$@" | |
} | |
function dockershellhere() { | |
dirname=${PWD##*/} |