Skip to content

Instantly share code, notes, and snippets.

@jamespenguin
jamespenguin / fortune.py
Created July 5, 2011 17:53
Fortune cookie message getter
#!/usr/bin/env python
#
# Fortune Cookie Saying Grabber
# By James Penguin (brandon.smith@gmail.com)
#
import BeautifulSoup
import urllib2
def get_fortune():
try:
@jamespenguin
jamespenguin / speaker_beep.py
Created August 31, 2011 21:19
Speaker beeping fun in Python.
#!/usr/bin/env python
#
# Internal Speaker Beeping Module for Windows
#
import time
import winsound
###
# Notes Config
###
@jamespenguin
jamespenguin / gist:1913487
Created February 26, 2012 05:29
it's a secret
int bufferWidth = CVPixelBufferGetWidth(pixelBuffer);
int bufferHeight = CVPixelBufferGetHeight(pixelBuffer);
uint8_t *pixel = CVPixelBufferGetBaseAddress(pixelBuffer);
uint8_t * baseAddressGray = (uint8_t *) malloc(bufferWidth*bufferHeight);
intrinsicBGRAtoGrayscale(baseAddressGray, pixel, bufferWidth*bufferHeight);
for (int i = 0; i < (bufferWidth * bufferHeight); i++) {
pixel[0] = baseAddressGray[0];
pixel[1] = baseAddressGray[0];
@jamespenguin
jamespenguin / gist:1978009
Created March 5, 2012 11:58
asdfdsafadsf
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="keywords" content="Ping 4,Ping chapter 4,Ping,Ping manga,Ping chapter 4 page 26" />
<meta name="description" content="Ping 4 - Read Ping 4 Manga Scans Page 26. Free and No Registration required for Ping 4 v01" />
<title>Ping 4 v01 - Read Ping 4 Online - Page 26</title>
<meta property="og:title" content="Ping 4 Page 26" />
<meta property="og:description" content="Ping 4" />
@jamespenguin
jamespenguin / process_itc_reports.py
Created May 4, 2012 13:25
iTunes Connect Financial Reports Processor
#!/usr/bin/env python
#
# iTunes Connect Earnings Report Merger Script
# By Brandon Smith (brandon.smith@studiobebop.net)
#
import os, csv, json
import requests
###
# Config
int x, y, width, height;
x = cardImage.size.width * 0.09; // 14% of the card image's width
y = cardImage.size.height * 0.05; // 8.5% of the card image's height
width = cardImage.size.width * 0.83; // 61.5% of the card image's width
height = cardImage.size.height * 0.85; // 7% of the card image's height
CGRect name_crop_rect = CGRectMake(x, y, width, height);
UIImage *name_image = [cardImage croppedImage:name_crop_rect];
amiami.rb --
class AmiAmi < FigureWatch::Adapter
def item_data(item_url)
# Initialize item object
item = FigureWatch::Item.new
item.seller = "AmiAmi"
item.item_url = item_url
%div{:align => 'center'}
- if not @error_message.nil?
%p.error= "<b>ERROR:</b> #{@error_message}"
%form{:action => '/stalk_item'}
%input{:type => 'text',
:autofocus => '1',
:name => 'search_text',
:placeholder => 'Paste item URL here.',
:value => 'http://www.amiami.com/top/detail/detail?scode=FIG-MOE-3475',
asdfasdf
x = "name"
puts "Good Morning Sir,"
print " What is your name? "
puts " Morning \"#{name}\" "
x = x.split ""
puts x
x = x.join ""
puts x