Skip to content

Instantly share code, notes, and snippets.

View Binero's full-sized avatar

Jeroen B Binero

  • Belgium
  • 07:53 (UTC +02:00)
View GitHub Profile
@Binero
Binero / binsbooks.xml
Created May 11, 2020 13:46
example.xml
<?xml version="1.0" encoding="UTF-8"?>
<book id="130185358">
<title>Example Book</title>
<author>Binero</author>
<content>
<page>
<line>This is an example book!</line>
<line>Thank you for using <u>binsbooks</u>!</line>
</page>
@Binero
Binero / terrible_code.rs
Created November 26, 2017 00:12
This is terrible code. Don't look.
if if let Some(entry) = self.entries.get_mut(index) {
updater(entry);
true
} else {
false
} {
for on_entry_update_listener in &self.on_entry_update_listeners {
on_entry_update_listener(self, entry_id);
}
true
@Binero
Binero / playground.rs
Created November 5, 2015 18:15 — forked from anonymous/playground.rs
Shared via Rust Playground
#![feature(raw)]
use std::mem;
trait HasData<T> {
fn get(&self) -> T;
}
pub struct Entity;
@Binero
Binero / Results
Created September 28, 2015 19:12
Reference benchmark
test bench_noref ... abcdefghijklmnopqrstuvwxyz
bench: 5,535 ns/iter (+/- 212)
test bench_ref ... abcdefghijklmnopqrstuvwxyz
bench: 5,503 ns/iter (+/- 130)
cargo bench 7,02s user 0,23s system 98% cpu 7,378 total
grep --color=auto bench 0,22s user 0,22s system 5% cpu 7,378 total
jeroen@laptop-archlinux ~/Documents/Projects/testbench/reftest (git)-[master] % cargo bench | grep bench
test bench_noref ... abcdefghijklmnopqrstuvwxyz
bench: 5,631 ns/iter (+/- 306)
test bench_ref ... abcdefghijklmnopqrstuvwxyz
#version 330
in vec2 fPosition;
out vec4 outColour;
void main() {
outColour = vec4(0.0, 0.0, 0.0, 0.2);
float dist = distance(fPosition, vec2(0.0, 0.0));
float delta = fwidth(dist);
float alpha = smoothstep(0.5-delta, 0.5, dist);
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/AppTheme.ActionBar</item>
</style>
<style name="AppTheme.ActionBar"
parent="@style/Widget.AppCompat.ActionBar">
<item name="android:background">#00FF00</item>
project: Project = {
name = "EpicTool"
version = "1.0.0"
description = "Epic tool for epic people. "
example_project = git("https://github.com/example/example-project")
targets = [
{
target = file("bin/epictool")
source_dir = "src/"