Skip to content

Instantly share code, notes, and snippets.

View roncli's full-sized avatar

Ronald M. Clifford roncli

View GitHub Profile
@roncli
roncli / index.js
Created August 15, 2022 20:20
Standard labels for GitHub
const githubLabelSync = require("github-label-sync");
(async () => {
try {
const diff = await githubLabelSync({
accessToken: process.env.GITHUB_ACCESS_TOKEN,
repo: process.env.GITHUB_REPO,
labels: [
{
"name": "bug",
@roncli
roncli / tetrisai.htm
Created January 11, 2021 07:55
NES Tetris AI Background - Uses Blockrain & JQuery
<html>
<head>
<script>
/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null
@roncli
roncli / inventory.cs
Created June 9, 2020 08:54
AddItemToInventory refactor
/**
* This is a refactor of https://twitter.com/MegaMasterX/status/1270039734388232195. It is untested, but shows proof of concept for improvements over the original code.
* I make an assumption that MaxStack is also a property on the item, not just on PlayerItems[i]. Ideally, it should *only* be a property on the item itself, but if there's a design reason for it to be kept with the player's inventory (ie: changing MaxStack limits as a reward for something), then item.MaxStack will need to be replaced with something else.
*
* This makes a few changes to the original code for better quality of life for the player:
* In the original code, if a player holds a stack of 10 and a stack of 5 of an item that has a MaxStack of 10 and then picks up a stack of 1 of the same item, the end result is a stack of 10, a stack of 5, and a stack of 1. In this code that is corrected to a stack of 10 and a stack of 6.
* In the original code, if a player holds a stack of 5 and a stack of 5 of an item that has a MaxStack
@roncli
roncli / README.md
Last active July 16, 2019 22:44
TL;DR for OTL Season 1 Survey Feedback

OTL Rules:

Friendly fire:

  • No change. It might make an appearance in a One-Day tournament, but given historical experience and the amount of negative reactions I've had to the idea, it may not happen soon.

Game length:

  • No change. Some wanted shorter matches, but teams are already playing multiple matches, having the overhead of making shorter matches means there will be less overall playing time.

Ties:

  • No change, regular season and One-Day tournament matches will end in a tie, Mid-season and Championships tournaments will have 3 minute overtime periods until there's a winner.
@roncli
roncli / multitwitch.htm
Created February 23, 2019 22:03
Multitwitch
<html>
<head>
<script>
document.addEventListener("DOMContentLoaded", (ev) => {
const urlParams = new URLSearchParams(window.location.search),
users = urlParams.get("users").split(",");
let status = 0,
player = 0;
@roncli
roncli / setup.sh
Last active October 19, 2021 02:44
Overload Ubuntu 18.04 Private Server Setup
#!/bin/bash
# Install dotnet core 2.2
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2
@roncli
roncli / Content\Content.mgcb
Created February 11, 2019 17:35
MonoGame no MSAA repro
#----------------------------- Global Properties ----------------------------#
/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False
@roncli
roncli / !How to get a Base 64 string from a canvas.md
Last active January 2, 2017 03:14
How to get a Base 64 string from a canvas

How to get a Base 64 string from a canvas

This project demonstrates how to get a Base 64 string from a Canvas using only JavaScript. Be advised that this only works for files on the same server, otherwise the Canvas will be tainted and will not allow you to export it.

To use:

  1. Clone the Gist and run npm install from the root of the project.
  2. Run node index.
  3. Navigate to http://localhost:10177, and you will see the Base 64 string of the Canvas in an alert box.
@roncli
roncli / descent-side-by-side.htm
Created May 27, 2015 05:30
Descent Videos Side By Side
<html>
<head>
<style>
@font-face {
font-family: "D2";
src: local("Descent ][");
}
body {
position: relative;