$ vagrant ssh -c "cd /vagrant; rustc --target=wasm32-unknown-emscripten hello.rs"
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
// 失敗する例 (オリジナル: https://gist.github.com/cohama/73a90d99fa036030393727ecd51fcb13) | |
// 何が起きているのかを明示するため若干修正済み。 | |
fn main() { | |
let k0 = |r| println!("{:?}", r); // このクロージャの型を仮に K0 とする | |
repeat_cps(10, "hello", Box::new(k0)); // repeat_cps::<&'static str, (), K0> がインスタンス化される | |
} | |
// 型パラメータを持つ場合、それらの型「すべて」が確定したときに関数は初めて実体化される(C++と同じ)。 |
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
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'tomtom/tcomment_vim' | |
Plug 'mklabs/split-term.vim' | |
Plug 'rakr/vim-two-firewatch' | |
Plug 'hzchirs/vim-material' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'Shougo/echodoc.vim' |
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
// WARNING: This output format is intended for human consumers only | |
// and is subject to change without notice. Knock yourself out. | |
static <impl at <anon>:11:1: 33:2>::display::__STATIC_FMTSTR: &[&str] = { | |
let mut _0: &[&str]; // return pointer | |
let mut _1: &[&str; 2]; | |
let mut _2: &[&str; 2]; | |
let mut _3: [&str; 2]; | |
bb0: { | |
_3 = [const "", const "\n"]; // scope 0 at <println macros>:3:18: 3:43 |
I hereby claim:
- I am ubnt-intrepid on github.
- I am ubnt_intrepid (https://keybase.io/ubnt_intrepid) on keybase.
- I have a public key ASBfMbdQVepmekRFwK86hKRejg3eKoSLHQc_TtkxLhhTUgo
To claim this, I am signing this object:
Usage:
> $command = "vim"
> rustc -C opt-level=3 -C debuginfo=0 -o "C:\path\to\$($command).exe" wsl.rs
> C:\path\to\vim.exe .\wsl.rs
TODO:
- Windows 側のパスを受け取った場合の対処
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
# HTTP protocol | |
http[s]://HOST[:PORT]/ORGANIZATION/REPOSITORY.git | |
# Git protocol | |
git://HOST/ORGANIZATION/REPOSITORY.git | |
# SSH protocol | |
[ssh://]SSHUSER@HOST[:PORT]/ORGANIZATION/REPOSITORY.git |
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
#[macro_use] | |
extern crate itertools; | |
use std::cmp; | |
use itertools::Itertools; | |
pub fn mandelbrot(buffer: &mut [u8], width: i64, height: i64, pixel_size: f64, x0: f64, y0: f64) { | |
iproduct!((0..width), (0..height)).foreach(|(i, j)| { | |
let cr = x0 + pixel_size * (i as f64); | |
let ci = y0 + pixel_size * (j as f64); |