Skip to content

Instantly share code, notes, and snippets.

@darthtrevino
darthtrevino / cthulubot-privacy-policy.md
Created September 24, 2023 18:41
CthulhuBot Privacy Policy

Privacy Policy for CthulhuBot on Discord

Last Updated: 9/24/2023

  1. Introduction

This Privacy Policy outlines how we collect, use, and protect your information when you use CthulhuBot on the Discord platform.

  1. Information We Collect
@darthtrevino
darthtrevino / chulthubot-terms-of-service
Last active September 24, 2023 18:39
CthulhuBot Terms of Service
Terms of Service for CthulhuBot on Discord
Last Updated: 9/24/2023
# Introduction
Welcome to the Terms of Service (ToS) for CthulhuBot, a bot service on the Discord platform. By inviting or using CthulhuBot in your server or interacting with it in any manner, you agree to these terms.
# Acceptance of Terms
type Unsubscribe = () => void
type EffectId = string | symbol
type EffectFn = () => Unsubscribe | undefined
class SideEffects implements ReactiveController {
private effectDeps: Record<EffectId, unknown[]> = {}
private effectUnsubscribes: Record<EffectId, Unsubscribe | undefined> = {}
public constructor(private host: ReactiveControllerHost & Element) {
@darthtrevino
darthtrevino / example.js
Created November 5, 2018 18:52
useDimensions Hook (Replace AutoSizer)
// NOTE: Adapted from TS code, stripped types out
import React, { useRef, useState, useEffect } from 'react'
/**
* A custom hook that uses a resizeObserver to change dimension state
* @param defaultDimensions { width: number, height: number}
*/
export function useDimensions(defaultDimensions) {
const [dimensions, setDimensions] = useState(defaultDimensions)
@darthtrevino
darthtrevino / sequelize_relay_cursor_pagination.ts
Last active February 6, 2018 17:52
A Helper for Implementing Relay's Cursor-Based Pagination with Sequelize
const { fromGlobalId, toGlobalId } = require("graphql-relay");
import {FindOptions} from "sequelize";
export interface ICursorPageable {
// Backward Paging Arguments
before?: string;
last?: number;
// Forward Paging Arguments
after?: string;
@darthtrevino
darthtrevino / unixsort.sh
Last active November 16, 2015 06:36
File Sorting Using Shell-Based Mapreduce
#!/bin/sh
CWD=`pwd`
TMP=`mktemp -d`
trap "rm -rf $TMP" EXIT
pushd $TMP
split -l5000 $1
popd
for file in $TMP/*
@darthtrevino
darthtrevino / Console Output
Created November 25, 2014 05:14
AWS-SDK #417 - authorizeSecurityGroupIngress Error
node test.js
ERROR: { [MissingParameter: Source group ID missing.]
message: 'Source group ID missing.',
code: 'MissingParameter',
time: Mon Nov 24 2014 21:10:59 GMT-0800 (PST),
statusCode: 400,
retryable: false,
retryDelay: 30 }
@darthtrevino
darthtrevino / CoffeScript_Chained_Lambas.coffee
Created September 10, 2011 08:36
CoffeeScript chained lambdas for aop-based drawing
ctx = $('#canvas')[0].getContext("2d")
palette = {Gray:'#E8E8E8', Black:'#000000'}
point = (xVal, yVal) -> {x: xVal, y: yVal}
line = (from, to) ->
ctx.moveTo(from.x, from.y)
ctx.lineTo(to.x, to.y)
ctx.stroke()
class Chain
constructor: ->