Skip to content

Instantly share code, notes, and snippets.

View stith's full-sized avatar

Anna Stith stith

View GitHub Profile
@stith
stith / readme.md
Created September 28, 2023 10:39
Rekordbox .flac to .aiff conversion

quick script that, given a rekordbox library.xml file, converts all .flac files to .aiff, preserving file metadata like cue points, play count, and album art. also maintains the file's bit rate.

probably will fail in some weird cases that i didn't have to care about with my tiny baby library

@stith
stith / ess2cbwarp.py
Created September 20, 2011 11:49
Convert Essentials warps to CommandBook's CSV
#!/usr/bin/env python
import sys
import yaml
import os
import time
from os import path
# Make sure paths exist
if len(sys.argv) != 2:
@implementation Observer
-(id)init {
// ...
[_preferences addObserver:self forKeyPath:@"apiKey" options:NSKeyValueObservingOptionNew context:nil];
[_preferences addObserver:self forKeyPath:@"apiSecret" options:NSKeyValueObservingOptionNew context:nil];
}
// ...
// Type this into your address bar at simple.com:
// It just messes with the background, don't worry about your cookies :D
javascript:void(function(){disPage.guilloche.guillocheKey=0;setInterval(function(){disPage.guilloche.guillocheKey++; disPage.guilloche.drawNiceGuilloche();},100)}());
@stith
stith / strace.sh
Created February 25, 2012 08:28
strace all processes
strace $(pidof httpd |sed 's/\([0-9]*\)/\-p \1/g')
NSString *filename = [NSString stringWithFormat:@"%0.0f.png", [[NSDate date] timeIntervalSince1970]];
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
MSLogTo(@"info", @"documentsPath = %@",documentsPath);
NSURL *newUrl = [NSURL fileURLWithPath:documentsPath isDirectory:YES];
NSString *saveTo = [[newUrl absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
MSLogTo(@"info", @"Saving image to %@",saveTo);
NSError *error;
if (![UIImagePNGRepresentation(image) writeToFile:saveTo options:NSDataWritingAtomic error:&error]) {
@stith
stith / ess2sc.py
Created September 20, 2011 08:49
Convert Essentials homes to SpawnControl
#!/usr/bin/env python
import sys
import sqlite3
import yaml
import os
import time
from os import path
# Make sure paths exist
@stith
stith / AOD.patch
Created May 19, 2011 07:04
Magento 1.4.1.1 Memory Leak Patch
*** lib/Varien/Db/Select.php 2010-07-26 16:09:28.000000000 -0400
--- lib/Varien/Db/Select.php 2010-12-28 15:42:19.000000000 -0500
***************
*** 33,38 ****
--- 33,40 ----
*/
class Varien_Db_Select extends Zend_Db_Select
{
+ const TYPE_CONDITION = 'TYPE_CONDITION';
+
@stith
stith / .htaccess
Created May 6, 2011 03:41
The ultimate Magento SEO .htaccess rewrite rule set
# Grab the protocol being used
RewriteCond %{HTTPS} =on
RewriteRule ^(.+)$ - [env=ps:https]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.+)$ - [env=ps:http]
# Force WWW
RewriteCond %{HTTP_HOST} !^www\.
@stith
stith / engineswap.php
Created May 4, 2011 04:40
Mass MySQL storage engine updater
<?php
// Update tables from one storage engine to another
//
// Written by Matt Stith for Nexcess.net
// May 3, 2011
//
// CLI only
if (!defined('STDIN')) {