Skip to content

Instantly share code, notes, and snippets.

View tylermenezes's full-sized avatar
🌵
Hello

Tyler Menezes tylermenezes

🌵
Hello
View GitHub Profile
@tylermenezes
tylermenezes / parse-ach.py
Created September 19, 2012 00:53
Parses an ACH download from Square1Bank and turns it into a CSV
import re
import sys
class Transaction:
def __init__(self, lines):
for line in lines.split("\n"):
parts = re.sub('\s+', ' ', line.strip()).split(' ')
if(parts[0][0:8] == 'CUSTOMER'):
if (parts[1][0:4] == '****'):
self.card = parts[1][5:]
@tylermenezes
tylermenezes / remove-rdio-garbage.js
Created December 9, 2012 10:01
Removes unavailable and preview albums from rdio. This is particularly useful after using the "Sync" feature, since it's useless and generates hundreds of "Unavailable" albums. Scroll to the bottom of your collection first, since it's lazy loaded.
(function(){
var i = 0;
var count = $('.Album.unavailable,.Album.preview').length;
console.log('Found ' + count + ' albums to remove');
var timeout = 0;
$('.Album.unavailable,.Album.preview').each(function(){
var instance_i = i++;
var album = $(this);
album.trigger('mouseover').mouseenter();
album.find('a,div,span,image').trigger('mouseover').mouseenter();
@tylermenezes
tylermenezes / fb-notif-proxy-partial.php
Created December 15, 2012 09:43
Avoid the requirement that you have a Canvas app to send FB notifications by setting the window top location. Probably against the TOS. Uses CuteControllers, although the concept is easy to copy in any framework.
public function __post_index()
{
$to = $this->request->request('to');
if ($to === NULL) {
$to = '/index.html';
}
$to = \CuteControllers\Router::link($to);
@tylermenezes
tylermenezes / xserver-xorg-video-intel-2.20.14-crtc.patch
Created April 10, 2013 04:34
Add virtual CRTC to Intel Xorg driver
diff --git a/src/intel_display.c b/src/intel_display.c
index 2c93c2d..57dea60 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -121,6 +121,8 @@ struct intel_output {
struct list link;
};
+#include "virtual_display.c"
+
@tylermenezes
tylermenezes / gh_localhost_sync.py
Created June 27, 2013 18:49
Creates apache sites for local Github repos
import os
from subprocess import call
def get_projects(github_directory):
top_level_directories = [d for d in os.listdir(github_directory)]
for directory in top_level_directories:
project_directories = [[directory, p] for p in os.listdir(os.path.join(github_directory, directory))]
for project in project_directories:
yield project
@tylermenezes
tylermenezes / removedeliciousbookmarks.js
Last active December 22, 2015 07:48
Remove all Del.icio.us links showing up on a page. Linking your Twitter to Delicious automatically bookmarks all Tweets you favorite without warning you. (Or at least it did at the time I linked it.) This is extraordinarily stupid. This script can remove them. Just search for @Yourusername #"from twitter", scroll down to the bottom of the page, …
(function(){
var timeout = 0;
window.confirm = function(){return true;}
$("a[title='Edit this link']").each(function(){
var editBtn = $(this);
setTimeout(function(){editBtn.click();}, timeout);
timeout += 750;
setTimeout(function(){$("a[href='#remove']").click();}, timeout);
timeout += 2000;
@tylermenezes
tylermenezes / rebind_air.sh
Last active December 24, 2015 00:09
Macbook air keybinding script for Ubuntu
#!/bin/bash
echo "remove Mod1 = Alt_L
remove Mod1 = Alt_R
remove Control = Control_L
remove Control = Control_R
remove Mod4 = Super_L
remove Mod4 = Super_R
keysym Super_R = Control_R
@tylermenezes
tylermenezes / drafttypekit.userscript.js
Created December 9, 2013 22:35
Adds a personal Typekit kit to Draft
// ==UserScript==
// @name Draft Typekitizer
// @namespace http://tyler.menez.es/
// @version 1
// @description Adds Typekit to Draft
// @match http*://*.draftin.com/*
// @copyright 2013 Tyler Menezes
// ==/UserScript==
(function() {

Keybase proof

I hereby claim:

  • I am tylermenezes on github.
  • I am tylermenezes (https://keybase.io/tylermenezes) on keybase.
  • I have a public key whose fingerprint is AB9D CF71 97DB 8E12 7D52 BD76 98C0 08FE 06DF 0C41

To claim this, I am signing this object:

@tylermenezes
tylermenezes / SaveWave.js
Created July 14, 2014 04:35
Exports checked Wave transactions as a CSV
$.makeArray($('.financial-transaction-item').map(function(x, e){
if (!$(e).find('.financial-transaction-checkbox input').is(':checked')) return;
var is_negative = $(e).is('.expense');
return {
date: $(e).find('.financial-transaction-date input').val(),
description: $(e).find('.financial-transaction-description input').val(),
amount: parseFloat($(e).find('.financial-transaction-amount .js-amount-readonly').attr('title').replace(',', '')) * (is_negative? -1 : 1),
raw_amount: $(e).find('.financial-transaction-amount .js-amount-readonly').attr('title'),
elem: e
};}).map(function(x,e){ return e.date+',"'+e.description+'",'+e.amount; })).join("\n")