Skip to content

Instantly share code, notes, and snippets.

View RyanSquared's full-sized avatar

Ryan RyanSquared

View GitHub Profile
[package]
name = "testingstuffs"
version = "0.1.0"
authors = ["Ryan"]
[features]
debug = []
[dependencies]
pest = "~1.0"
@RyanSquared
RyanSquared / test.py
Created March 17, 2018 00:34
Program to migrate LDAP data to hashbang/userdb
# pylint: disable-all
# Search LDAP for all People of hashbang.sh
import json
import sys
import ldap
import ldap.resiter
import psycopg2
@RyanSquared
RyanSquared / controller.sh
Last active April 13, 2018 00:06
Docker controller for Minecraft
#!/bin/bash
# vim:set noet sts=0 sw=2 ts=2:
RCON_PASSWORD="Ryan_Minecraft_Server"
set_option() {
opt=$(grep "^$1=" data/server.properties)
if [ $? -ne 0 ]; then
echo "$1=$2" >> data/server.properties
echo "Added new option: '$1=$2'"
@RyanSquared
RyanSquared / proposal.md
Last active April 18, 2017 18:17
Proposal for #! webservers

Proposal for Web Servers and Redirects

Draft for user-run services and user-provided static files served over HTTP

tl;dr

# dns for lrvick.hashbang.sh points to ny1.hashbang.sh via CNAME
https://lrvick.hashbang.sh -(custom daemon, SNI proxy)> ny1.hashbang.sh:/home/lrvick/proxy.sock
# dns for lrvick.da1.hashbang.sh points to da1.hashbang.sh via CNAME
@RyanSquared
RyanSquared / gitc.lua
Last active December 20, 2017 18:34
Greater Ixnay Time Calculator
local epoch = os.time{year=2014,day=0,month=0}
-- equation: x + y = 2016*365+182; x + z = 2024*365; z = y * 4
-- this assumes 4x rate past normal time
-- attempts to use 3x rate could not provide accurate results following timestamps
function conv(t)
local time = os.time(t)
local seconds_since_epoch = time - epoch
return seconds_since_epoch * 4 + epoch
end
@RyanSquared
RyanSquared / MIT-non-endorsed.txt
Created March 15, 2017 07:28
MIT license with a nonendorsement clause
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@RyanSquared
RyanSquared / lfsi15m.fuse
Last active June 3, 2017 04:35
Learn FusionScript in 15 Minutes!
-- Two dashes start a comment. Comments go until the end of the line. Anything
-- after the start of the comment will be ignored. This document is designed
-- for FusionScript version 0.2.0 but may be compatible with future versions.
print("Hello World -- Learn FusionScript in 15 Minutes!");
using *;
------------------------------
-- 1. Assignment and Values
@RyanSquared
RyanSquared / lmsi15m.md
Last active January 3, 2018 14:30
Learn MoonScript in 15 minutes!

You can try this code using an online compiler.

-- Two dashes start a comment. Comments can go until the end of the line.
-- MoonScript transpiled to Lua does not keep comments.

-- As a note, MoonScript does not use 'do', 'then', or 'end' like Lua would and
-- instead uses an indented syntax, much like Python.

--------------------------------------------------
@RyanSquared
RyanSquared / practices.md
Last active January 6, 2017 23:34
Recommended Practices for IRC Clients, Servers, and Libraries
layout title excerpt meta-description index
page
Recommended Practices
Recommended Practices
Recommended practices that don't strictly relate to IRC
true

Certain protocols and algorithms exist that can improve IRC performance but aren't strictly related to IRCv3. This page lists some of these that are recommended to be implemented. They're not listed as specifications because they are not implemented in

@RyanSquared
RyanSquared / repl.lua
Created December 25, 2016 07:49
REPL for FusionScript?
local lexer = require("fusion.core.lexer")
local parser = require("fusion.core.parsers.source")
local function do_string(input)
local ok, err = pcall((loadstring or load)(input)) -- luacheck: ignore
if not ok then
print(err)
end
end