Skip to content

Instantly share code, notes, and snippets.

@xentec
xentec / PKGBUILD
Created February 29, 2016 10:22
tinc-custom-git
# Maintainer: Xentec <xentec at aix0 dot eu>
# Contributor: Oliver (thechauffeur) Weidner <[email protected]>
pkgname=tinc-custom-git
pkgver=1.1pre11.r211.gbf50b35
pkgrel=1
pkgdesc="VPN (Virtual Private Network) daemon "
arch=('i686' 'x86_64')
url="https://github.com/gsliepen/tinc"
license=('GPL')
@xentec
xentec / glang.md
Last active February 22, 2016 13:53
Standard #15

glang - a note.d

premature as fuck (hence the cursing)

Principles

  • Game of Life: Complex pattern through simple rules.
  • use familiar concepts
# Maintainer: Xentec <xentec at aix0 dot eu>
# Contributor: Oliver (thechauffeur) Weidner <[email protected]>
pkgname=tinc-nolegacy-git
pkgver=1.1pre11.r311.gea75c24
pkgrel=1
pkgdesc="A full mesh p2p VPN daemon without legacy bloat"
arch=('i686' 'x86_64')
url="https://github.com/xentec/tinc"
license=('GPL')
@xentec
xentec / util.d
Last active February 9, 2016 14:47
/* Return the number of running processes of the system */
ulong getProcNum()
{
version(linux)
{
import std.file, std.algorithm, std.ascii;
return "/proc".dirEntries(SpanMode.shallow).count!(a => a.name.baseName.all!isDigit);
}
}
@xentec
xentec / break-variant.d
Created December 30, 2015 15:30
std.variant breaking
void buildVar(DBusMessageIter *iter, Variant var, int sig)
{
import std.meta;
alias basic = AliasSeq!(byte,bool,short,ushort,int,uint,long,ulong,double,string);
foreach(T; basic) {
T* p = var.peek!T;
if(p) {
buildIter!T(iter, *p);
break;
<?php
/* PHP System Status
* ------------------------------------------
* Author: wutno (#/g/tv - Rizon)
* Last update: 1/4/2012 5:28AM -5GMT (USELESS BLOAT)
*
*
* GNU License Agreement
* ---------------------
* This program is free software; you can redistribute it and/or modify
@xentec
xentec / camera.cpp
Last active August 29, 2015 14:27
Quaternion camera
const vec3 Camera::axisV = {0.f, 1.f, 0.f};
const vec3 Camera::axisF = {0.f, 0.f, 1.f};
mat4 Camera::getView(const vec3& pos, const quat& rot) const
{
vec3 up = rot * axisV;
vec3 forward = rot * axisF;
return glm::lookAt(pos, pos + forward, up);
}
import
std.array,
std.conv,
std.string;
version(Have_vibe_d) {
import vibe = vibe.inet.url;
}
/*
string humanByte(byte decimals = 2)(double bytes)
{
import std.string;
enum suffix = [ "", "K", "M", "G", "T", "P", "E"];
byte i;
while(bytes > 1024.0) {
bytes /= 1024.0;
i++;
@xentec
xentec / showdown.js
Last active December 23, 2015 05:39
showdown extension for math expressions in AsciiMath and TeX
//
// MathJax Extension
// $$ F = m * a $$ -> ` F = m \cdot a `
// $$$ F = m * a $$$ -> <script type="math/tex; mode=display"> F = m \cdot a </script>
//
//
// Dont forget to include
//
// <script type="text/javascript"
// src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML">