Skip to content

Instantly share code, notes, and snippets.

/*
* Roam template PoC by @ViktorTabori
* 0.1alpha
*
* forked by @everruler12
* v1 2020-08-07
* include moment.js and replace ::current_time:: and ::today:: variables in template
*
* forked by @mrap
* 2020-10-26
/* Copy this into your [[roam/css]] page */
/* IMPORT CORE THEME */
@import url('https://azlen.github.io/roam-themes/core.css');
/* GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap');
:root {
--page-width: 616px;
@mrap
mrap / results.md
Created April 6, 2017 20:50
Benchmarks for getting object type in go. http://stackoverflow.com/a/27160765/2078664

go test -bench=. -benchmem

BenchmarkTypeof-4          	10000000	       153 ns/op	      16 B/op	       1 allocs/op
BenchmarkReflectTypeOf-4   	50000000	        27.4 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/mrap/bench/typeof	3.099s
@mrap
mrap / .cVimrc
Last active August 29, 2015 14:25
OS Agnosttic cvimrc
" Settings
set noautofocus
set cncpcompletion
set linkanimations
set showtabindices
set smoothscroll
set hud
let searchlimit = 20
@mrap
mrap / gist:b64f39ee81706e02c4bc
Last active August 29, 2015 14:15
Calculating max fluid volume in O(n) time
#include <iostream>
#include <algorithm>
typedef int pillar_t;
pillar_t* read_pillars(int);
int get_volume(pillar_t *, int);
int main() {
@mrap
mrap / quicksort_benchmark.rb
Created March 15, 2014 14:01
Benchmarking a quicksort algorithm designed to handle duplicates.
require 'benchmark'
class RubyQuicksort
def self.prepare(number_of_items)
time_taken = Benchmark.realtime{ generate_random_array number_of_items }
puts "Took #{time_taken}s to generate an array of #{number_of_items} random items"
end
def self.generate_random_array(number_of_items)