Skip to content

Instantly share code, notes, and snippets.

View roam-templates.js
/*
* 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
View pleasantcore-zenith-roam-theme.css
/* 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 Apr 6, 2017
Benchmarks for getting object type in go. http://stackoverflow.com/a/27160765/2078664
View results.md

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 Aug 29, 2015
OS Agnosttic cvimrc
View .cVimrc
" Settings
set noautofocus
set cncpcompletion
set linkanimations
set showtabindices
set smoothscroll
set hud
let searchlimit = 20
@mrap
mrap / gist:b64f39ee81706e02c4bc
Last active Aug 29, 2015
Calculating max fluid volume in O(n) time
View gist:b64f39ee81706e02c4bc
#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 Mar 15, 2014
Benchmarking a quicksort algorithm designed to handle duplicates.
View quicksort_benchmark.rb
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)