Skip to content

Instantly share code, notes, and snippets.

View mre's full-sized avatar
🪴
I like plants.

Matthias Endler mre

🪴
I like plants.
View GitHub Profile
// This is an algorithm, which creates an ID for a podcast episode.
// It is based on the the podcast's title, episode's title, the episode number,
// the date of the episode and the episode's mp3 file name.
//
// All fields can change over time, but the ID should remain the same.
// Think of it more like a user agent string than a unique ID: it is "unique
// enough" for identifying episodes in most cases.
//
// It's used to identify episodes in the database.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mre
mre / top2.json
Created January 4, 2021 22:05
Top Github Users by followers October 2020
[
{
"data": {
"search": {
"userCount": 2646,
"edges": [
{
"node": {
"login": "torvalds",
"followers": {
fn main() {
println!("{}", foo);
}
@mre
mre / pyenv install -v 3.6.5
Created July 17, 2018 23:24
pyenv install -v 3.6.5
+ [pyenv:22] enable -f /usr/local/bin/../libexec/pyenv-realpath.dylib realpath
+ [pyenv:29] '[' -z '' ']'
++ [pyenv:31] type -p greadlink readlink
++ [pyenv:31] head -1
+ [pyenv:31] READLINK=/usr/local/bin/greadlink
+ [pyenv:32] '[' -n /usr/local/bin/greadlink ']'
+ [pyenv:54] '[' -z '' ']'
+ [pyenv:55] PYENV_ROOT=/Users/mendler/.pyenv
+ [pyenv:59] export PYENV_ROOT
+ [pyenv:62] '[' -z '' ']'
@mre
mre / lib.rs
Created June 1, 2018 12:51
Proptest
#[cfg(test)]
#[macro_use]
extern crate proptest;
extern crate chrono;
use chrono::prelude::*;
use std::convert::From;
use std::num::ParseIntError;
@mre
mre / gist:301153a121caa310f7c11c21cc2bf5dc
Created May 18, 2018 18:11
building stdgba with latest nightly
cargo build ✘ 130
Compiling g v0.1.0 (file:///Users/mendler/Code/snippets/rust/g)
Compiling gbaimg v0.1.0 (file:///Users/mendler/Code/snippets/rust/g/gbaimg)
warning: unused import: `Term`
--> gbaimg/src/lib.rs:8:43
|
8 | use proc_macro::{ TokenStream, TokenTree, Term };
| ^^^^
|
= note: #[warn(unused_imports)] on by default
@mre
mre / main.rs
Created March 9, 2018 01:15
A simple clone of `ls -l` in Rust
extern crate chrono;
extern crate libc;
#[macro_use]
extern crate structopt;
use std::fs;
use std::path::PathBuf;
use std::error::Error;
use std::process;
use std::os::unix::fs::PermissionsExt;
@mre
mre / main.c
Created January 2, 2018 20:32
Darwin/macOS copyfile example usage
#include <copyfile.h>
int main()
{
copyfile("test.txt", "copy.txt", 0, COPYFILE_ALL);
}
@mre
mre / each.rb
Created December 16, 2017 16:06
["Ruby", "Rust", "Python", "Cobol"].each do |lang|
puts "Hello #{lang}!"
end