Skip to content

Instantly share code, notes, and snippets.

View turt2live's full-sized avatar
🌲
Trees are cool. We should have more of them.

Travis Ralston turt2live

🌲
Trees are cool. We should have more of them.
View GitHub Profile
@tulir
tulir / .checkroom.sh
Last active April 9, 2020 08:45
Matrix room server version checker
#!/bin/bash
if [[ -z "$HOMESERVER" ]]; then
echo "Please set the HOMESERVER environment variable to the C-S API URL (e.g. https://matrix.org)"
exit 1
elif [[ -z "$ACCESS_TOKEN" ]]; then
echo "Please set the ACCESS_TOKEN environment variable to your access token"
exit 1
elif [[ -z "$1" ]]; then
echo "Usage: $0 <alias without #>"
exit 1
@ara4n
ara4n / perl.md
Last active July 16, 2021 09:49
Everything you need to know about Perl5

I once wrote one of these before for @NegativeMjark but I think I lost it. So here's another.

All you need to know is:

  • $foo is a scalar (i.e. a single dimensional variable)
  • @foo is an array. $foo[n] is the element of an array.
  • %foo is a hash. $foo{'moo'} aka $foo{moo} is the value in the hash for key 'foo'.
  • \ is the reference operator. it returns a scalar which points to the address of the variable (like & in C).
  • (1, 2, 3) is a list. (an array is a variable which contains a list).
  • [1, 2, 3] (rarely: \(1,2,3)) is a reference to a list - aka arrayref
  • $foo-&gt;[n] gives an element of an arrayref
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API

Setting a default color scheme (tint) for Riot on your account

Caution: This requires some amount of technical knowledge about how matrix/riot works.

For reference, the original grey color scheme in Riot had a primary color of #595959 and a secondary color of #ececec

  1. Open the developer tools by typing /devtools
  2. Click the "Explore Account Data" button
  3. Click the "im.vector.web.settings" button (if you don't have this button, use the instructions below instead)
@ara4n
ara4n / dendrite-install.sh
Last active June 27, 2017 16:20
Build guide/script for Dendrite experimentation
# Dendrite guide
# start with Debian Stretch
apt-get install golang-1.8 postgresql
apt-get install openjdk-8-jre-headless # needed for kafka (which in future will be an optional dependency)
# Set up DBs
su postgres -c 'createuser dendrite'
# This should be the public-facing name (ie: dns name)
HOME_SERVER_URL="https://matrix.org"
# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in riot-web
ROOM_ID="!AbCDef823s:matrix.org"
# This is your user ID and access token. The access token must match the user.
USER_ID="@turt2live:matrix.org" # The home server should match this domain as well (ie: t2l.io as a HS should be :t2l.io in the user)
ACCESS_TOKEN="token_here"
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;