Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile

HTML5 Audio Player w/ Responsive Playlist

I changed this!

This is an HTML5 audio player that detects the user agent of your device/browser/OS and applies styling that matches the native audio player. The playlist responds to the width of your screen and features basic UI controls.

Feel free to fork this pen and add your own user agent styles for different browsers, devices and operating systems.

@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@tsabat
tsabat / supervisor.conf
Created December 28, 2011 15:09
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@tsabat
tsabat / lets_breakup.py
Last active July 1, 2022 16:18
Breaks a large csv file up into smaller chunks.
#!/usr/bin/env python
import sys
import csv
import argparse
from pathlib import Path
import chardet
from urllib3 import encode_multipart_formdata
csv.field_size_limit(sys.maxsize)
@tsabat
tsabat / redis_clients.sh
Created September 7, 2013 19:41
a unique list of all connected redis clients
redis-cli client list | awk '{print $1}' | sed s/addr=//g | sed s/:.*//g | uniq
@tsabat
tsabat / settings.py
Created February 7, 2021 22:32 — forked from defulmere/settings.py
How to override an old sqlite3 module with pysqlite3 in django settings.py
# first: pip install pysqlite3-binary
# then in settings.py:
# these three lines swap the stdlib sqlite3 lib with the pysqlite3 package
__import__('pysqlite3')
import sys
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
DATABASES = {
'default': {
@tsabat
tsabat / unused.py
Created February 22, 2014 20:42
delete unused ebs volumes
#! env python
from boto import ec2
conn = ec2.connect_to_region('us-west-2')
vols = conn.get_all_volumes(filters={'status': 'available'})
for vol in vols:
print 'checking vol:', vol.id, 'status:', vol.status, 'attachment_id:', vol.attach_data.status
conn.delete_volume(vol.id)
1) "schedules_changed"
2) "stat:processed:2018-08-06"
3) "stat:failed:2018-09-06"
4) "stat:failed:2020-03-01"
5) "stat:failed:2020-01-12"
6) "stat:failed:2018-10-12"
7) "stat:processed:2018-09-01"
8) "stat:processed:2019-09-27"
9) "stat:failed:2020-02-23"
10) "stat:processed:2018-12-08"
@tsabat
tsabat / port_forward.md
Last active March 26, 2020 06:27
port forwarding bash script

We hide the services behind an AWS Security Group. But, we can use some trusty SSH action to forward localhost ports to those on the Solr server.

After you've added this to your ~/.zshrc or ~/.bash_profile and sourced (source ~/.bash_profile) it, you can forward these ports from localhost to your server like so:

portforward <hostname>

zsh and bash handle string splitting differently, so be sure to choose correctly for your shell.

@tsabat
tsabat / index.haml
Created September 26, 2018 17:38
qMevwg
%h1 hi