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 / gvextract.js
Created October 30, 2011 23:11
Extract messages from Google Voice
(function() {
  var el=document.createElement('div'),
      b=document.getElementsByTagName('body')[0],
      otherlib=false,
      msg='';
  el.style.position='fixed';
  el.style.height='32px';
  el.style.width='220px';
  el.style.marginLeft='-110px';
  el.style.top='0';
@tylermenezes
tylermenezes / split.py
Created November 11, 2011 03:23
Splits GCode
#!/usr/bin/python
import sys
if len(sys.argv) < 2:
print "Usage: split.py [filename]"
quit()
with open(sys.argv[1], 'r') as f:
data = f.readlines()
@tylermenezes
tylermenezes / gist:1895600
Created February 23, 2012 23:06
Code for finding enviroment variable location
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *ptr;
if(argc < 3) {
printf("Usage: %s <envvar> <program>\n", argv[0]);
exit(0);
@tylermenezes
tylermenezes / gist:1895672
Created February 23, 2012 23:23
Stripe CTF Level 3 Hints
What are all the numbers less than 4. There are a lot of them.
//IRMusicPlayer
//Jennifer Schumaker
//22.Feb.12
// PIND is an Arduino command that gets a byte containing the input
// status of bytes 0 through 7. In our case we want the bit
// corresponding to pin 2.
// NOTE: If you are seeking input from ports 8 - 15 use PINDB.
// For analong pins 0 - 5 use PINC
//
@tylermenezes
tylermenezes / hideShow.js
Created March 21, 2012 16:47
Script for extracting proxies from HideMyAss
(function(){
$.fn.hasAttr = function(name) {
return this.attr(name) !== undefined;
};
$("*").filter(function(e){
return $(this).hasAttr("style") && $(this).attr("style").indexOf("none") != -1;
}).each(function(e,s){
$(this).remove();
});
$("#listtable tr").each(function(e,s){
@tylermenezes
tylermenezes / index.php
Created March 29, 2012 00:44
Stripe Example for Leland
<?php
// ________ ___________ _________ ________ ________ ____ __ ______ ____ ___ ____ ______
// /_ __/ / / / _/ ___/ / _/ ___/ /_ __/ / / / ____/ / __ \/ / / / __ \ / __ \/ | / __ \/_ __/
// / / / /_/ // / \__ \ / / \__ \ / / / /_/ / __/ / /_/ / /_/ / /_/ / / /_/ / /| | / /_/ / / /
// / / / __ // / ___/ / _/ / ___/ / / / / __ / /___ / ____/ __ / ____/ / ____/ ___ |/ _, _/ / /
// /_/ /_/ /_/___//____/ /___//____/ /_/ /_/ /_/_____/ /_/ /_/ /_/_/ /_/ /_/ |_/_/ |_| /_/
// This is what gets executed whenever the page is submitted.
// Standard stuff:
@tylermenezes
tylermenezes / async_helpers.js
Created May 6, 2012 07:50
Javascript Async Helpers
(function(window) {
var delegates = {};
var getId = function(milli) {
return (new Date()) + "+" + milli + "-" + Math.floor(Math.random());
}
var returningLater = function(id, noGc) {
return function(){
delegates[id]();
@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 / 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);