Skip to content

Instantly share code, notes, and snippets.

@dhasenan
dhasenan / gist:6fff33d7a6da0877cef9
Created March 22, 2015 17:24
nim needlessly recompiling deps
Hint: used config file '/home/dhasenan/.config/nim.cfg' [Conf]
Hint: used config file '/home/dhasenan/prog/lux/Source/lux.nim.cfg' [Conf]
/home/dhasenan/prog/lux/modules/urho/container/vector.nim(8, 62) Hint: 'T' is declared but not used [XDeclaredButNotUsed]
/home/dhasenan/prog/lux/modules/urho/container/vector.nim(103, 76) Hint: 'T' is declared but not used [XDeclaredButNotUsed]
/home/dhasenan/prog/lux/modules/urho/math/color.nim(55, 53) Warning: 'l' should not be used as an identifier; may look like '1' (one) [SmallLshouldNotBeUsed]
/home/dhasenan/prog/lux/modules/urho/container/allocator.nim(26, 71) Hint: 'T' is declared but not used [XDeclaredButNotUsed]
/home/dhasenan/prog/lux/modules/urho/container/hashmap.nim(8, 68) Hint: 'U' is declared but not used [XDeclaredButNotUsed]
/home/dhasenan/prog/lux/modules/urho/container/hashmap.nim(8, 65) Hint: 'T' is declared but not used [XDeclaredButNotUsed]
/home/dhasenan/prog/lux/modules/urho/container/hashmap.nim(38, 86) Hint: 'U' is declared but not used [XDeclar
@dhasenan
dhasenan / gist:78d2cc89c110506dbe2d
Created April 5, 2015 14:09
simpler unittest example
import unittest, macros
suite "foo":
test "bar":
check 1 == 1
test "fails":
check 1 == 2
// ==UserScript==
// @name no light fonts
// @namespace http://ikeran.org
// @description prevents sites from using font-weight below 400
// @include *
// @version 1
// @grant none
// ==/UserScript==
(function() {
import
std.stdio,
std.file,
std.regex,
std.json,
std.algorithm,
std.range,
std.array,
std.traits,
std.format;
-- * Adam is a widower. He was married to Bea (deceased) with whom he had two children: Clive and Doris.
-- * Eric is divorced. He was married to Fiona. Fiona has two children by a previous marriage, Greta and Hillary. Eric shares parental responsibilities for G and H with Fiona.
-- * Adam and Eric are currently married.
-- * Because Adam and Eric don't have enough headaches, Fiona is currently acting as a surrogate and is pregnant with Adam's child, who will be adopted by Eric.
-- Design a fully normalized database schema that can accommodate this family.
CREATE TABLE human
(
id UUID NOT NULL PRIMARY KEY,
name VARCHAR(255) NULL, -- some people don't have names
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName git.ikeran.org
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ProxyPreserveHost On
SSLCertificateFile /etc/letsencrypt/live/git.ikeran.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/git.ikeran.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
@dhasenan
dhasenan / dub.service
Last active April 6, 2018 03:36
dub registry systemd service (put in /etc/systemd/system/)
[Unit]
Description=DUB package registry
After=network.target
[Service]
WorkingDirectory=/opt/dub
ExecStart=/opt/dub/dub-registry --mirror https://code.dlang.org/ --port 8005
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
@dhasenan
dhasenan / clamp.d
Created April 12, 2018 02:33
clamp value with contracts
T clamp(T)(T min, T max, T value)
in
{
assert(min <= max);
}
do
{
if (min > value) return min;
if (max < value) return max;
return value;
@dhasenan
dhasenan / beard.vim
Created April 9, 2024 20:35
Beard vim colorscheme
" Vim colorscheme forked from...I forget what
set t_Co=256
let g:colors_name="beard"
let python_highlight_all = 1
let c_gnu = 1
hi Normal ctermfg=225 ctermbg=None cterm=None