Skip to content

Instantly share code, notes, and snippets.

@maxwofford
maxwofford / xoxc.js
Created January 10, 2024 16:38
Pull the XOXC token from Slack
// open slack in the browser and paste this into your console for the XOXC token
localConfig = JSON.parse(localStorage.getItem('localConfig_v2'))
localConfig.teams[localConfig.lastActiveTeamId].token
first:
- Imagination
- Intelligence
- Integrity
- Innovation
- Inclusion
- Impact
- Curiosity
- Mystery
- Family
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby File.read(File.join(File.dirname(__FILE__), ".ruby-version")).strip
gem "dotenv-rails", groups: [:development, :test]
# gem 'sassc-rails' # required for rails 6
/*
@title: Sokoban+
@author: Leonard (Omay)
25 levels
3 types of boxes and 3 types of goals
Press WASD to move, J to restart and K to toggle trails
Get A boxes (cyan) to A goals (green)
Get B boxes (magenta) to B goals (red)

How do I track what a demo account is?

The Utopian future

  • Users individually sign contracts
  • Contracts are just for creating accounts– you can still invite a team member who doesn’t have a contract
  • You can signup without a contract, but an account isn’t active until at least 1 contract-signed users are onboard

The MVP

import { readLines } from "https://deno.land/std@0.161.0/io/buffer.ts";
async function main() {
for await (const line of readLines(Deno.stdin)) {
let parts = line.split(" ");
if (parts.length == 14) {
let timestamp = new Date(parts[0]).getTime() / 1000;
let ip = parts[7].replace("fwd=", "").replace(/"/g, "");
let request = parts[4].replace("path=", "").replace(/"/g, "");
body {
font-family: 'Avenir Next', system-ui;
}
h1 {
color: #ec3750;
}
img {
animation: spin 10s linear infinite;

Ideal vp9 encoding:

ffmpeg -i <source> -c:v libvpx-vp9 -pass 1 -b:v 1000K -threads 1 -speed 4 \
  -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 \
  -g 9999 -aq-mode 0 -an -f webm /dev/null


ffmpeg -i <source> -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 1 -speed 0 \
  -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 \
 -g 9999 -aq-mode 0 -c:a libopus -b:a 64k -f webm out.webm
1. Install samba:
```
// https://www.raspberrypi.org/documentation/remote-access/samba.md
$ sudo apt update -y
$ sudo apt install samba samba-common-bin smbclient cifs-utils -y
```
2. Create folder & backup old files
```
$ cd ~/.octoprint
$ mv uploads uploads.bak && mkdir uploads # optional
last_page = false
usernames = []
function nextPage(lastPage=false) {
newUsernames = Array.from(document.querySelectorAll('.user-list-item>div>div>a')).map(a => a.innerText)
usernames = usernames.concat(newUsernames)
lastPage = document.querySelector('.next_page').className.split(' ').indexOf('disabled') != -1
if(!lastPage) {
setTimeout(() => {