Skip to content

Instantly share code, notes, and snippets.

local client = require('discordia').Client()
local allowableRoles = {{"681281731869147208", "He/Him"}, {"681281755080294443", "She/Her"}, {"681281780220690520", "They/Them"}}
client:on('messageCreate', function(message)
for i=1,3 do
local id, name = unpack(allowableRoles[i])
if message.content == "!pronouns "..name then
local member = message.member
if not member then break end
<?php
require __DIR__.'/vendor/autoload.php';
use GDText\Box;
use GDText\Color;
define("DEBUG", false);
if(DEBUG) {
header("Content-Type: text/plain");
} else {
header("Content-Type: image/png");
<?php
use \parallel\Runtime;
use \parallel\Channel;
$runtime = new Runtime();
Channel::make("TEST_CHANNEL", 1024);
$future1 = $runtime->run(function(){
$channel = Channel::open("TEST_CHANNEL");
sleep(2);
$channel->send("foo");
sleep(1);
<?php
declare(strict_types = 1);
use iggyvolz\DocBlockParser\Tag;
use iggyvolz\DocBlockParser\Subtag;
use iggyvolz\DocBlockParser\DocBlockParser;
require_once __DIR__."/../vendor/autoload.php";
/**
* fin
* bax @foo bar bak @bin bar @boo bay @boo yak
@iggyvolz
iggyvolz / test.php
Last active November 19, 2019 18:28
Test case for phan/phan#3524
<?php
function get_thing_might_be_null():?int
{
return 7;
}
{
if($foo = get_thing_might_be_null() && $foo > 5) {
echo "hello world";
}
}
@iggyvolz
iggyvolz / test.php
Created October 10, 2019 16:35
FQSEN resolution failure
<?php
namespace foo{
class y
{
}
}
namespace bar{
use foo\y;
use phpDocumentor\Reflection\Types\ContextFactory;
@iggyvolz
iggyvolz / README
Created September 25, 2019 16:09
Verilog data source generator
Store the testbench data in a csv file. First column should be the signal names, second column the lengths, remaining columns signals to test
@iggyvolz
iggyvolz / gist:aab783b8c4a081ccd1ec590a3f4c30cb
Last active May 23, 2019 16:47
Firefox preload polyfill for Link headers
// https://gist.github.com/yoavweiss/b1f798bb2be4e671107b#file-preload_feature_detection-js
const supportsPreload = (function() {
try {
return document.createElement("link").relList.supports('preload');
} catch (e) {
return false;
}
}());
if (supportsPreload) {
console.log("Supports preload");
# Install build dependencies for 64-bit
sudo apt update
sudo apt install -y build-essential autotools-dev autoconf debhelper docbook-to-man docbook-utils docbook-xsl fontforge libacl1-dev libasound2-dev libavcodec-dev libcapi20-dev libcups2-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgphoto2-dev gcc-8 libgsm1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libice-dev libkrb5-dev liblcms2-dev libldap2-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libosmesa6-dev libpcap-dev libpulse-dev libsane-dev libsdl2-dev libssl-dev libudev-dev libv4l-dev libva-dev libxcomposite-dev libxcursor-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev prelink sharutils unixodbc-dev bison flex gawk quilt rdfind symlinks gperf systemtap-sdt-dev libaudit-dev libcap-dev libselinux-dev g++-8-multilib
mkdir ~/build
# Download and build glibc
cd ~/build
wget http://archive.ubuntu.com/ubuntu/pool/
# Install dependencies
sudo apt install schroot debootstrap
# Setup chroot
echo "[ubuntu_i386]"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "description=Ubuntu Release 32-Bit"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "personality=linux32"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "directory=$PWD"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "root-users=$USER"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "type=directory"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf
echo "users=$USER"|sudo tee -a /etc/schroot/chroot.d/ubuntu_i386.conf