Skip to content

Instantly share code, notes, and snippets.

@socksy
socksy / shellelectric.js
Created April 8, 2022 11:32
blink.sh theme for shellelectric
t.prefs_.set('color-palette-overrides',
[ '#51595e', '#e47e71', '#90cba6', '#f6c693',
'#8aa9d1', '#bf94c3', '#9edad6', '#94a1a8',
'#7e898e', '#f6819e', '#80b7a0', '#f9997e',
'#97c3d3', '#c5a2c0', '#b5ede6', '#c5c8c6' ]);
t.prefs_.set('foreground-color', '#f5e6c2');
t.prefs_.set('background-color', '#464d51');
t.prefs_.set('cursor-color', 'rgba(255,255,255,0.5)');
- Have items
- Item is some text with some metadata
- Some metadata is strongly defined (status, category)
- The rest is weakly defined, but has useful datatypes (namely, enum, dates)
- Each item has an id
- the first half of the id is the location where it is (making it a uri), the second can be anything as long as it's a unique reference on that service to that item
- Items have locations, which can differ per service
- they can mean something semantically, or they could be totally arbitrary
- a full list of locations and their restrictions (or lack of them) should be available per service
- a restriction on a location can include:
@socksy
socksy / .conky_dzen
Created April 18, 2016 23:30
xmonad stuff
background yes
out_to_console yes
out_to_x no
# Update interval in seconds
update_interval 1
user_spacer left
pad_percents 2
lua_load ~/.xmonad/.conky_lua_scripts.lua
TEXT
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
{ config, pkgs, ... }:
{
# Use the gummiboot efi boot loader.
# n.b. no GRUB settings like everyone tells you to do
boot.loader.gummiboot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.enableB43Firmware = true;
Xft.dpi: 220
Xft.autohint: 0
Xft.rgba: rgb
Xft.antialias: 1
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
{ config, pkgs, ... }:
# Enable the X11 windowing system.
{
services.xserver = {
enable = true;
layout = "gb";
xkbVariant = "mac";
xkbOptions = "caps:escape,compose:escape";
@socksy
socksy / huffman.py
Created November 18, 2014 10:19
An example of how to implement huffman in python
#!/usr/bin/env python
#author 100004004
#Huffman encoding
import random
import math
#Constant for the end of transmission symbol
EOT = chr(4)
def get_source_weights():
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at java.util.Arrays.copyOf (Arrays.java:2367)
java.lang.AbstractStringBuilder.expandCapacity (AbstractStringBuilder.java:130)
java.lang.AbstractStringBuilder.ensureCapacityInternal (AbstractStringBuilder.java:114)
java.lang.AbstractStringBuilder.append (AbstractStringBuilder.java:587)
java.lang.StringBuffer.append (StringBuffer.java:332)
java.io.StringWriter.write (StringWriter.java:77)
java.io.StringWriter.append (StringWriter.java:202)
java.io.StringWriter.append (StringWriter.java:41)
clojure.core/fn (core_print.clj:181)
@socksy
socksy / traversal.clj
Last active December 26, 2015 22:49
Post-order traversal with a zipper in clojure
;WARNING: this puts your entire tree in memory, so if you're using zippers
;to avoid that, do not use this.
;Also, potentially terrible clojure. I only learned this a few days ago
;couldn't find any way to do this online except for a single
;stackoverflow that didn't actually use zippers
(require '[clojure.zip :as zip])
(defn zip-down [loc]
"Zips to the bottom of the tree from this loc"
(loop [p loc]
(if (zip/branch? p)