This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gc.h" | |
/** | |
* Adds destructor to garbage shadow stack. | |
* | |
* @param frame is passed automatically by wrapper macro | |
* @param fn takes one argument | |
* @param arg is passed to fn(arg) | |
* @return arg | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WM {{{ | |
# Focus node | |
# If no window exist, target monitor/desktop instead | |
super + k | |
bspc node -f north || bspc monitor -f north | |
super + j | |
bspc node -f south || bspc monitor -f south | |
super + h | |
bspc node -f west || bspc monitor -f west || bspc desktop -f prev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
uint64_t s[2]; | |
uint64_t | |
xorshiftrng128(void) | |
{ | |
uint64_t s1 = s[0]; | |
uint64_t s0 = s[1]; | |
uint64_t result = s0 + s1; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Inscrutabilis / mailto:iinscrutabilis@gmail.com | |
*/ | |
/* | |
* Generates a geodesic sphere geometry | |
* By default, it is 1x1x1 octahedron, as a first approximation to sphere | |
* It will return more sphere-like object if you specify iterations > 0 | |
* But please keep in mind that it generates (4 ^ iterations) * 8 faces | |
* Radius argument overrides default sphere radius (1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 330 core | |
in vec2 v_texcoord; | |
in vec4 v_color; | |
uniform sampler2D u_tex; | |
uniform mat4 u_combined; | |
out vec4 f_color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# A simple stop watch for a quick timer to check app performance | |
# | |
# @see https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/ | |
# | |
# @example Basic Usage | |
# timer = Stopwatch.new | |
# timer.start #=> 59539.814152996 | |
# timer.stop #=> 59544.700881683 | |
# timer.elapsed #=> 4.886728687000868 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <arpa/inet.h> | |
typedef struct buffer | |
{ | |
uint32_t length; | |
uint32_t capacity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mach_gettime.h" | |
#include <mach/mach_time.h> | |
#define MT_NANO (+1.0E-9) | |
#define MT_GIGA UINT64_C(1000000000) | |
// TODO create a list of timers, | |
static double mt_timebase = 0.0; | |
static uint64_t mt_timestart = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOSTNAME = %x{hostname}.chomp | |
PROM_FILE = ARGV[0] != 'test' ? '/var/lib/node_exporter/textfile_collector/smartctl.prom' : '/tmp/smartctl.prom' | |
DEVICES = [ | |
'/dev/sda', | |
'/dev/sdb', | |
'/dev/sdc', | |
'/dev/sdd', | |
'/dev/sde', |