Skip to content

Instantly share code, notes, and snippets.

View charlesvdv's full-sized avatar

Charles Vandevoorde charlesvdv

View GitHub Profile
@charlesvdv
charlesvdv / main.go
Created February 14, 2020 20:06
google hash code 2020 practice: more pizza solution
package main
import (
"bufio"
"io"
"log"
"os"
"sort"
"strconv"
"strings"
@charlesvdv
charlesvdv / keybase.md
Created July 11, 2018 12:26
Keybase verification file

Keybase proof

I hereby claim:

  • I am charlesvdv on github.
  • I am charlesvdv (https://keybase.io/charlesvdv) on keybase.
  • I have a public key whose fingerprint is 46DA B091 D17D A486 3901 0F7A BC2E AC5B 136A AEBE

To claim this, I am signing this object:

@charlesvdv
charlesvdv / .clang_format
Created October 4, 2017 17:51
Opinionated clang format
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
@charlesvdv
charlesvdv / Cargo.toml
Last active September 15, 2020 18:38
xcb + cairo test (translated in Rust from https://www.cairographics.org/cookbook/xcbsurface.c/)
[package]
name = "xcb_cairo"
version = "0.1.0"
authors = ["Charles Vandevoorde <charles.vandevoorde@hotmail.be>"]
[dependencies]
xcb = "0.7.6"
[dependencies.cairo-rs]
git = "https://github.com/charlesvdv/cairo"
@charlesvdv
charlesvdv / main.rs
Created April 29, 2017 16:07
experimentation with winit
extern crate winit;
use winit::os::unix::WindowExt;
fn main() {
let events_loop = winit::EventsLoop::new();
let window = winit::WindowBuilder::new()
// .with_title("A fantastic window!")
.with_dimensions(100, 100)
@charlesvdv
charlesvdv / WeatherActivity.java
Created April 18, 2017 07:18
example of recyclerview with click detail
package be.charlesvdv.weatherreport;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import org.w3c.dom.Text;
public class WeatherActivity extends AppCompatActivity {
@charlesvdv
charlesvdv / Cargo.toml
Created March 10, 2017 16:19
An iterator design pattern example written in Rust
[package]
name = "iterator-design-parttern"
version = "0.1.0"
authors = ["Charles Vandevoorde <charles.vandevoorde@hotmail.be>"]
[dependencies]
clap = "2.20.5"
@charlesvdv
charlesvdv / test.sh
Last active July 5, 2016 20:01
Launch multiples times "make test" to catch a random error
#!/bin/bash
declare -i i=1
declare -i bug=0
while [ $bug -lt 50 ]; do
echo "TEST NUMBER: "$((i++))" BUG NUMBER: "${bug}
echo "STAT: "$(bc <<< "scale = 5; $bug/$i")
out=$(make gotest)