Skip to content

Instantly share code, notes, and snippets.

View JelteF's full-sized avatar

Jelte Fennema-Nio JelteF

View GitHub Profile
@JelteF
JelteF / slicemap_test.go
Last active May 12, 2023 17:15 — forked from grahamking/slicemap_test.go
Benchmark comparing map access vs slice search
package main
import (
"math/rand"
"testing"
"time"
)
const (
numItems = 100 // change this to see how number of items affects speed
@JelteF
JelteF / .inputrc
Created August 16, 2019 13:51
input-rc
$include /etc/inputrc
# Don't require two tabs to show al completions
set show-all-if-ambiguous On
# search prefixes with arrow up and down
"\e[A":history-search-backward
"\e[B":history-search-forward
# Set Ctrl-w to stop at slashes and spaces instead of only spaces
@JelteF
JelteF / plus_one.rs
Created June 14, 2018 13:02
A mutating plus one function in rust
struct MyNumber {
n: i64,
}
// &mut MyNumber is the type for a mutable reference to MyNumber
fn plus_one(number: &mut MyNumber) {
number.n += 1;
}
// Rust doesn’t have nil-able pointers at all in most code (they do exist,

Keybase proof

I hereby claim:

  • I am jeltef on github.
  • I am jeltef (https://keybase.io/jeltef) on keybase.
  • I have a public key ASCo9ElT8wvIKpbAEVzuq1JMjRf2-gCT_ic8sag3YdwPIAo

To claim this, I am signing this object:

! "Enabled modi" Set from: Default
! rofi.modi: window,run,ssh
! "Window opacity" Set from: Default
! rofi.opacity: 100
! "Window width" Set from: Default
! rofi.width: 50
! "Number of lines" Set from: Default
! rofi.lines: 15
! "Number of columns" Set from: Default
! rofi.columns: 1
@JelteF
JelteF / gist:9557173
Created March 14, 2014 21:18
Pen markdown output script (using to-markdown)
var content = $('.pen_editor').html();
//remove divs and replace them with a \n
content = content.replace(/(<div>)/ig,"\n");
content = content.replace(/(<\/div>)/ig,"");
// Add an extra \n before and after lists to make sure the contents of
// the list and of the rest are separate.
content = content.replace(/(<(ol|ul)>)/ig, '\n$1');
content = content.replace(/(<\/(ol|ul)>)/ig, '$1\n');