Skip to content

Instantly share code, notes, and snippets.

View TooManyBees's full-sized avatar

Jess Bees TooManyBees

  • 271ft above sea level
View GitHub Profile
@TooManyBees
TooManyBees / mastodon_search.rb
Last active January 25, 2023 16:34
Search script for my own mastodon posts
#!/usr/bin/env ruby
# My instance doesn't support full text searching of posts, but I always
# want to know whether or not I've already published the post I'm about
# to make, and have to scroll through my own timeline just to double
# check. Well no more!
# You must use the --url argument to select the instance and user to search.
# You must also use the --access-token argument if that server only accepts
# authenticated requests. (Get an access token from the server's Development
@TooManyBees
TooManyBees / ofApp.cpp
Last active January 18, 2020 04:06
openFrameworks wires
#include "ofApp.h"
void lineThroughPoint(const glm::vec2 &i, float slope, glm::vec2 &p1, glm::vec2 &p2) {
float x1 = i.x - i.y / slope;
float x2 = i.x + (ofGetHeight() - i.y) / slope;
p1.x = x1; p1.y = 0;
p2.x = x2; p2.y = ofGetHeight();
}
void drawRandomLine(const glm::vec2 &focus) {
@TooManyBees
TooManyBees / forest.scss
Last active August 5, 2019 19:27
foresty mastodon color theme
// Commonly used web colors
$success-green: #79bd9a; // Padua
$error-red: #df405a; // Cerise
$warning-red: #ff5050; // Sunset Orange
$gold-star: #00B59B; // Toggled favorite/boost icons - #ca8f04
// Variables for defaults in UI
$base-shadow-color: #000;
$base-overlay-background: #000;
$base-border-color: #fff;
@TooManyBees
TooManyBees / lisp.rs
Last active February 9, 2019 20:36
simple lispy interpreter
use std::mem;
use std::io::{self, Read};
#[derive(Debug, PartialEq, Eq)]
enum Token {
Paren,
Keyword(String),
Expression(Vec<Token>),
}
@TooManyBees
TooManyBees / BinaryCargo.toml
Last active March 18, 2018 17:29
Rust workspace/proc macro dependencies
[package]
name = "binary"
[lib]
crate-type = ["cdylib"]
[dependencies]
procedural-macro = { path = "../procedural-macro" }
library = { path = "../library" } # not using the codegen feature here

Keybase proof

I hereby claim:

  • I am toomanybees on github.
  • I am bees (https://keybase.io/bees) on keybase.
  • I have a public key ASBUuPLrOEN71rkSt0hc7uKUwqEQn-kN4YG5vU404NEdNAo

To claim this, I am signing this object:

@TooManyBees
TooManyBees / RAINBOW.pde
Created March 24, 2016 04:24
oh man, dance party incoming
import SimpleOpenNI.*;
SimpleOpenNI context;
PImage glitchBuffer;
void setup() {
size(640, 480);
context = new SimpleOpenNI(this);
@TooManyBees
TooManyBees / dump_asset_helper.rb
Created December 9, 2015 18:27
DumpAssetHelper - Ruby On Rails helper module to look up precompiled assets
# Include this in ApplicationHelper, or another view helper module
module DumpAssetHelper
# Helper for inlining compiled assets
# `dump_asset("lib/like_button.js")`
# `dump_asset("components/avatar.css", :once)`
def dump_asset name, option=nil
unless option == :once && dumped_assets.include?(name)
dumped_assets << name
asset = find_asset(name)
@TooManyBees
TooManyBees / quick_routes.rb
Last active August 29, 2015 14:15
Quicker routing helpers for Rails apps
# I hate the fact that Rails.application.routes.url_helpers.whatever
# is so damn slow.
#
# def tt n
# start = Time.now
# n.times { yield }
# Time.now - start
# end
#
# tt(100) { Rails.application.routes.url_helpers.entry_path(edition_id: 'us', id: 12345) }
@TooManyBees
TooManyBees / template.html
Created July 11, 2014 17:45
roll your own templater?
<div class="entry columns $col_classes bN" data-beacon="{'p':{'mpid':'$i'}}">
<div class="panel">
<a href="clickable" href="$entry_path"></a>
<div class="bN $img_size-img" data-beacon="{'p':{'lnid':'img'}}">
<div class="image-container" data-img-path="$img_path"></div>
</div>
<div class="panel-text">
<h5 class="cf bN" data-beacon="{'p':{'lnid':'hldn'}}">$headline</h5>
</div>
</div>