Skip to content

Instantly share code, notes, and snippets.

View little-arhat's full-sized avatar
🕵️‍♂️
What I had was a coat, a hat and a gun...

Roma Sokolov little-arhat

🕵️‍♂️
What I had was a coat, a hat and a gun...
View GitHub Profile
package com.github.larhat;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
# without core::fmt
cargo -v bloat --crates
Compiling ...
Analyzing target/thumbv7em-none-eabihf/debug/fcfs-rtfm
File .text Size Name
0.6% 26.8% 14.3KiB std
0.4% 19.3% 10.3KiB alt_stm32f30x_hal
0.3% 15.4% 8.2KiB mpu9250
0.3% 13.5% 7.2KiB stm32f30x
@little-arhat
little-arhat / x.rs
Created February 21, 2019 22:58
ehal spi transfer;; expanded
/// Blocking transfer
pub mod transfer {
/// Default implementation of `blocking::spi::Transfer<W>` for implementers of
/// `spi::FullDuplex<W>`
pub trait Default<W>: ::spi::FullDuplex<W> { }
impl <W, S> ::blocking::spi::Transfer<W> for S where
S: Default<W>, W: Clone {
type
Error
=
@little-arhat
little-arhat / rust-xargo.el
Last active April 2, 2018 19:28
flycheck-rust-xargo
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
(require 'flycheck)
(flycheck-define-checker rust-xargo
"A Rust syntax checker using Cargo.
This syntax checker requires Rust 1.17 or newer. See URL
`https://www.rust-lang.org'."
:command ("xargo"
(eval (if flycheck-rust-check-tests
#include <stdio.h>
/* Женя Зайцев, [Oct 6, 2017, 3:15:15 PM]: */
/* а, или появился */
/* появился, да */
int main(int argc, char* argv[]) {
printf("He\n");
if (1) {
#include <stdio.h>
/* Женя Зайцев, [Oct 6, 2017, 3:15:15 PM]: */
/* а, или появился */
/* появился, да */
int main(int argc, char* argv[]) {
printf("He\n");
if (1) {
@little-arhat
little-arhat / README.md
Last active March 8, 2017 20:04 — forked from Gonzih/README.md
markov-chain-meetup-dojo
(define data
(repeat 1000
(lambda () (sum (map (lambda (x)
(if x 1 0))
(repeat 10 coin))))))
@little-arhat
little-arhat / koans.md
Last active December 22, 2020 08:27
ocaml koans

original page, web-archive

let rec

One day, a disciple of another sect came to Xavier Leroy and said mockingly:

"The OCaml compiler seems very limited: why do you have to indicate when a function is recursive, cannot the compiler infer it?"

Xavier paused for a second, and replied patiently with the following story: