Skip to content

Instantly share code, notes, and snippets.

View aldeka's full-sized avatar

Karen Rustad Tölva aldeka

View GitHub Profile
@aldeka
aldeka / main.rs
Created December 5, 2022 06:51
advent of code 2022 day 5 parts 1 and 2
use std::fs;
type BoatStack = Vec<char>;
type Boat = Vec<BoatStack>;
#[derive(Debug)]
struct Instruction {
number_containers: u32,
boat_from: usize,
Dear Supervisor Slocum,
My name is Karen Tölva and I'm one of your constituents in Redwood City. I'm writing to encourage you and the rest of the board of supervisors to vigorously endorse SB 50.
There is no way to deny it: the bay area needs much more housing, just to keep up with the jobs created here. Major changes are needed to dig out from the hole of unbuilt housing that's developed over the last decade as both the economy took off and NIMBYs made it harder and harder for newer, denser, greener housing developments to get off the ground. We have got to have a better, stronger public policy around housing, and we cannot afford any more time letting the perfect be the enemy of the good. SB 50 is a major piece of the solution.
We've tried having local control. We've tried begging individual towns to build more. We've seen the result--members of city councils bragging about killing senior housing, low income housing, as well as market-price housing projects. The mayor of Cupertino joking about building a
@aldeka
aldeka / gist:9faed9d88332e32a77deb3ded91d1414
Created October 10, 2018 18:09
City Council Bicycle Transit Question
Hi! My name is Karen Tölva and I'm a Redwood City resident researching my options for the city council race. An issue I care a lot about is making bicycle commuting safe and convenient. I think that making it easy for people all over Redwood City and the larger region to bike to work is not just good for residents' health--it's vital for the planet and the easiest tactic to reduce traffic and get cars off the road. It also matters to me personally; I often commute by bike to work, but with the current state of our streets every day I have to choose between breaking the law by biking on the sidewalk for several stretches, or narrowly avoiding death in four-lane rush hour traffic.
I saw some statements about walkability and transportation policy on your website, but I couldn't find anything about cycling. If elected, what is your plan for improving and expanding bike access in Redwood City and in coordination with the larger region?
Thanks for your time,
-- Karen
@aldeka
aldeka / blogpost.md
Last active August 29, 2015 14:20
Things I hate: UI patterns the web presentation layer can't pull off

It's a fairly common UI pattern in chat programs. You have a set of people talking in a chatroom, and one person sends multiple messages in a row. Instead of styling each of these messages like one-off messages, you style the additional messages so they appear as a unit with the first message by that author, until interrupted by someone else. You remove horizontal border lines, or you make the message author's name only appear once, or you do some nice thing with padding. Whatever.

Screenshot of Slack exhibiting this message-merging behavior

This is a pretty common pattern. It's also something that obviously ought to be handled by the presentation layer--your application code shouldn't care what order the chat messages happen to come in, and you shouldn't have to add wrapper divs and other jiggery-pokery when subsequent messages come in or get deleted and worry about determining whether this "chunk" of messages is interrupted by other chats or not.

Unless the number

@aldeka
aldeka / Makefile
Last active August 29, 2015 14:01
LESS compilation and minification Makefile
SRC=static-src
DEST=static
LESS=less
JS=js
watchman=watchman
.PHONY : all clean watch
FILES_IN_CSS = $(shell find $(SRC)/$(LESS) -name *.less -maxdepth 1)
FILES_OUT_CSS = $(subst static-src,static,$(subst /less/,/css/compiled/,$(FILES_IN_CSS:.less=.css)))
@aldeka
aldeka / set.py
Created March 26, 2014 14:11
Set solver that looks for a deck where the first N plays have one and only one solution
import random
import itertools
NUMBERS = {1: "One", 2: "Two", 3: "Three"}
SHADES = {1: "Clear", 2: "Hatched", 3: "Solid"}
COLORS = {1: "Red", 2: "Green", 3: "Purple"}
SHAPES = {1: "Pill", 2: "Diamond", 3: "Tilde"}
@aldeka
aldeka / agpl_compliance.py
Created September 15, 2013 23:00
Sometimes people distribute python scripts that are licensed under the AGPL. Which means that they need to provide their own source code, lest they be in violation. Ergo...
import inspect, os, sys
fin = open(os.path.abspath(inspect.getfile(inspect.currentframe())))
for line in fin:
sys.stdout.write(line)
[alias]
a = add
ap = add -p
c = commit
cm = commit -m
cam = commit -am
caa = commit -a --amend
r = reset
rh = reset --hard
rhh = reset --hard HEAD
@aldeka
aldeka / Bad words
Created August 24, 2012 21:56
A comma-delimited list of bad words.
4r5e, 5h1t, 5hit, a55, anal, anus, ar5e, arrse, arse, ass, ass-fucker, asses, assfucker, assfukka, asshole, assholes, asswhole, a_s_s, b!tch, b00bs, b17ch, b1tch, ballbag, balls, ballsack, bastard, beastial, beastiality, bellend, bestial, bestiality, bi+ch, biatch, bitch, bitcher, bitchers, bitches, bitchin, bitching, bloody, blow job, blowjob, blowjobs, boiolas, bollock, bollok, boner, boob, boobs, booobs, boooobs, booooobs, booooooobs, breasts, buceta, bugger, bum, bunny fucker, butt, butthole, buttmuch, buttplug, c0ck, c0cksucker, carpet muncher, cawk, chink, cipa, cl1t, clit, clitoris, clits, cnut, cock, cock-sucker, cockface, cockhead, cockmunch, cockmuncher, cocks, cocksuck , cocksucked , cocksucker, cocksucking, cocksucks , cocksuka, cocksukka, cok, cokmuncher, coksucka, coon, cox, crap, cum, cummer, cumming, cums, cumshot, cunilingus, cunillingus, cunnilingus, cunt, cuntlick , cuntlicker , cuntlicking , cunts, cyalis, cyberfuc, cyberfuck , cyberfucked , cyberfucker, cyberfuckers, cyberfucking , d1ck,
<ul class="comment-actions">
<li class="approve {{ if post.type == 'approved'}}disabled{{ /if }}"><a href="#"><span></span>Approve</a></li>
<li class="spam {{ if post.type == 'spam'}}disabled{{ /if }}"><a href="#"><span></span>Spam</a></li>
<li class="delete {{ if post.type == 'deleted'}}disabled{{ /if }}"><a href="#"><span></span>Delete</a></li>
</ul>