Skip to content

Instantly share code, notes, and snippets.

Neia Neutuladh dhasenan

Block or report user

Report or block dhasenan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dhasenan
dhasenan / clamp.d
Created Apr 12, 2018
clamp value with contracts
View clamp.d
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 / dub.service
Last active Apr 6, 2018
dub registry systemd service (put in /etc/systemd/system/)
View dub.service
[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
View gitea-le-ssl.conf
<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>
View family_structure.sql
-- * 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
View templatesearch.d
import
std.stdio,
std.file,
std.regex,
std.json,
std.algorithm,
std.range,
std.array,
std.traits,
std.format;
View nolightfonts.js
// ==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() {
View gist:78d2cc89c110506dbe2d
import unittest, macros
suite "foo":
test "bar":
check 1 == 1
test "fails":
check 1 == 2
@dhasenan
dhasenan / gist:6fff33d7a6da0877cef9
Created Mar 22, 2015
nim needlessly recompiling deps
View gist:6fff33d7a6da0877cef9
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
You can’t perform that action at this time.