Skip to content

Instantly share code, notes, and snippets.

View edwardsharp's full-sized avatar
🥺
i'm a teapot

edward sharp edwardsharp

🥺
i'm a teapot
View GitHub Profile
@edwardsharp
edwardsharp / bucket_sync_service.rb
Created May 10, 2016 23:18
ruby class to copy from one aws s3 bucket to another based on bantic/bucket_sync_service.rb
require 'aws-sdk'
class BucketSyncService
attr_reader :from_bucket, :to_bucket, :logger
attr_accessor :debug
DEFAULT_ACL = "public-read"
def initialize(from_bucket, to_bucket)
@edwardsharp
edwardsharp / pd303b_VANILLA_time_bob.pd
Created May 31, 2024 04:03
pd303b_VANILLA_time_bob.pd
#N canvas 715 23 565 736 10;
#N canvas 15 39 1273 719 page-2 0;
#X obj 46 729 tgl 15 0 empty empty empty 17 7 0 10 -232576 -159808
-1 127 127;
#X obj 64 729 tgl 15 0 empty empty empty 17 7 0 10 -232576 -159808
-1 0 127;
#X obj 82 729 tgl 15 0 empty empty empty 17 7 0 10 -232576 -159808
-1 127 127;
#X obj 82 752 tgl 15 0 empty empty empty 17 7 0 10 -258113 -262144
-1 0 1;
@edwardsharp
edwardsharp / usb_disk.sh
Created February 4, 2022 19:28
init usb disk linux raspberry pi
# init usb disk
# substitute /dev/sda1 and WHAT-EVER-UUID with apropos valuez
sudo blkid
sudo mkfs -t ext4 /dev/sda1
sudo mkdir /mnt/teebee
sudo mount /dev/sda1 /mnt/teebee
# or whatever user. 🤷
sudo chown -R pi:pi /mnt/teebee
sudo umount /dev/sda1
ls -l /dev/disk/by-uuid/
@edwardsharp
edwardsharp / install_synapse_debian.sh
Created August 26, 2021 03:37
setup synapse, a matrix.org homeserver on debian 9
# setup synapse, a matrix.org homeserver
#
# note: this is intended to be a list of commandz,
# not a executable script...
#
# mostly ripped from https://upcloud.com/community/tutorials/install-matrix-synapse/
# and https://github.com/matrix-org/synapse/blob/develop/docs/setup/installation.md
su root
@edwardsharp
edwardsharp / renderers.tsx
Created January 1, 2021 20:30
react-markdown renderers to use material-ui theme and styles; with typings!
import React, { ReactNode } from 'react'
import { withStyles, Theme } from '@material-ui/core/styles'
import Typography, { TypographyProps } from '@material-ui/core/Typography'
import Link from '@material-ui/core/Link'
import Table from '@material-ui/core/Table'
import Paper from '@material-ui/core/Paper'
import {
TableHead,
TableRow,
TableCell,
@edwardsharp
edwardsharp / raindrop_reddit_thing.pd
Last active January 29, 2021 18:59
r/puredata raindrop_generator_on_bang
#N canvas 366 23 911 659 12;
#X obj 34 39 noise~;
#X obj 35 112 bp~ 80 0.4;
#X floatatom 69 65 5 0 0 0 - - -;
#X floatatom 102 87 5 0 0 0 - - -;
#X obj 35 135 lop~ 500;
#X obj 115 306 *~;
#X obj 115 329 *~ 30;
#X obj 35 232 *~ 30;
#X obj 35 255 +~ 40;
{
foo: 'bar',
baz: 'beep'
}
@edwardsharp
edwardsharp / install_phantomjs.sh
Created July 19, 2019 19:24
PhantomJS installer
#!/usr/bin/env bash
# This script will install PhantomJS on a Debian/Ubuntu System
#
# This script must be run as root:
# sudo sh install_phantomjs.sh
#
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1

Keybase proof

I hereby claim:

  • I am edwardsharp on github.
  • I am 3dwardsharp (https://keybase.io/3dwardsharp) on keybase.
  • I have a public key ASAMLhhvJpTWYQ3T_kjB0N6euzpJHHfx3-BUhidO2hqfPQo

To claim this, I am signing this object:

@edwardsharp
edwardsharp / base36_encode_decode.sql
Created December 14, 2017 19:27 — forked from btbytes/base36_encode_decode.sql
Base36 Conversion in PostgreSQL
-- source: http://www.jamiebegin.com/base36-conversion-in-postgresql/
CREATE OR REPLACE FUNCTION base36_encode(IN digits bigint, IN min_width int = 0)
RETURNS varchar AS $$
DECLARE
chars char[];
ret varchar;
val bigint;
BEGIN
chars := ARRAY['0','1','2','3','4','5','6','7','8','9'
,'A','B','C','D','E','F','G','H','I','J','K','L','M'