Skip to content

Instantly share code, notes, and snippets.

View eddyb's full-sized avatar

Eduard-Mihai Burtescu eddyb

View GitHub Profile
@eddyb
eddyb / mx-search
Last active July 4, 2024 09:02
Matrix offline regex search (using JSON exports from Element)
use git2::Delta;
use git2::DiffOptions;
use git2::Repository;
use std::collections::BTreeMap;
use std::env::set_current_dir;
use std::process::Command;
fn main() {
let repo = Repository::open_from_env().unwrap();
set_current_dir(repo.workdir().unwrap()).unwrap();
// cargo-deps: hsl, image, csv = "1.0.0-beta.4", serde, serde_derive
// ~~~ PUBLIC DOMAIN ~~~
// I, the copyright holder of this work, hereby release it
// into the public domain. This applies worldwide.
// In case this is not legally possible, I grant any entity
// the right to use this work for any purpose, without any
// conditions, unless such conditions are required by law.
extern crate csv;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package amedia;
import java.io.File;
import java.net.URL;
## NOTE: Space between elements of syntax rules is used to
## signify that whitespace is permitted at that position.
whitespace: ([ \n] | '#'[^\n]*'\n')*
# "Tokens"
## x is a variable, xx a function, Xx an array, XX a constant.
array_name: [A-Z]([a-z][a-zA-Z.]*)?
const_name: [A-Z][A-Z][A-Z._]*
@eddyb
eddyb / 01.md
Last active February 10, 2016 03:05
KOHCTPYKTOP designs

eNrtmVGSgjAQRCHNj2fYK+y/Z/H+F1mYCEySmUQESldbKiXF6w5JgK6hGH6Hn8ut
v1z7oXtmo/G1xn6rsd9qTA1BtqqxYWgZXYNnbBp459BII4000vgNRinngv8TCsBs
+2lA2YYOoY6H7kkemVbEk6kG+dlc0LgzrVxIBeOBu1F00/F1EpN+9gqcLFoQjVEW
O8slckrByYj0SBbNbFeadUWqovGgUpWrJ9aaJB+yTKklaXUSjhAY8zUlSpde5kUk
c7Jl64MVhaGps69Eetasn8rQvEXIJetF2a7JH9Sawr4e78ezu2Gn4MS4dGP6oRwn
JSUl/W7KqHyEwqVwvXB7BteZlJRR+YFxh3mniDtoc+JFnogLhZWVvC1JSRmV/yAq
4UYl3MqQdSMpKaOSy6US041ZuBUp3CAFg5SU9DOj8ugP8KH6/f0kGlyqy8CULn/I
qSbIvQkxYhblyMp6lZSU1KHnfOM+JCrttp++T92IWOwZdaOqArO6EbBf7QuigtQg
This file has been truncated, but you can view the full file.
@eddyb
eddyb / combinator.rs
Last active December 26, 2015 20:52 — forked from btipling/combinator.rs
fn main() {
fn map<F, T, A>(option: Option<T>, f: F)
-> Option<A>
where F: FnOnce(T) -> A {
match option {
None => None,
Some(value) => Some(f(value)),
}
#!/usr/bin/env bash
while :
do
g=$(echo "
t = $(date "+%S%N")/1000000000;
if(t < 5 || t > 58) {
t *= 10;
if(t==0) {
sinc = 1;
} else {
@eddyb
eddyb / cover.md
Last active February 24, 2016 18:39

Ever since I started programming, I have been looking for the perfect programming language, a language that could cover all domains without trading off performance for expressiveness.
Discovering Rust reignited this passion for achieving the universal balance, with safety as a new essential component.

After a couple years of working on the compiler and several other high-performance projects in Rust, I believe that this is the language to marry the raw power of the machine with the beautiful abstractions humans can conceive.

But Rust is barely getting started, and there is so much work to be done.
I want to empower developers with IDEs that make navigating, refactoring and understanding large codebases a breeze.
I want to make DSL-based frameworks as easy to put together as any other API.

These frameworks could be used to build everything, from back-end servers to WebAssembly+WebGL front-ends, from unikernels to native UIs, all finely tuned to specific tasks yet hot-swappable, featuring powerful debu