Skip to content

Instantly share code, notes, and snippets.

View mortehu's full-sized avatar

Morten Hustveit mortehu

  • Jump Trading
  • New York, New York
View GitHub Profile
@mortehu
mortehu / utf8.cc
Last active September 22, 2016 00:22
UTF-8 case folding in C++14
#include <codecvt>
#include <iomanip>
#include <iostream>
#include <locale>
#include <string>
#include "zip.h" // See https://gist.github.com/mortehu/373069390c75b02f98b655e3f7dbef9a
const auto low = u8"abcæøåαβγ";
const auto upp = u8"ABCÆØÅΑΒΓ";
@mortehu
mortehu / .vimrc
Created March 20, 2017 23:17
vimrc
let loaded_matchparen = 1
syntax on
map <Down> gj
map <Up> gk
filetype indent on
set cryptmethod=blowfish2
set tags=tags;/
set bg=dark
@mortehu
mortehu / prime-triangle.py
Last active May 18, 2018 22:50
Prime Triangle
#!/usr/bin/env python3
import fractions
import sys
def is_prime(n):
for d in range(2, int(n**0.5)):
if n % d == 0:
return False