Skip to content

Instantly share code, notes, and snippets.

View hwrdprkns's full-sized avatar
💭
I may be slow to respond.

Taylor H. Perkins hwrdprkns

💭
I may be slow to respond.
View GitHub Profile
@hwrdprkns
hwrdprkns / sessions_controller.rb
Created December 28, 2010 02:12
httparty problem
class SessionsController < ApplicationController
@base_uri = 'service.hwrdprkns.com:8080/'
def new
@title = 'Sign In'
end
def create
if params[:session][:email].blank? || params[:session][:password].blank?
@hwrdprkns
hwrdprkns / player.rb
Created January 7, 2011 07:13
Player Model
# == Schema Information
#
# Table name: players
#
# id :integer not null, primary key
# first_team :boolean
# preffered_position :string(255)
# rating :integer
# hometown :string(255)
# notes :text
@hwrdprkns
hwrdprkns / _error_messages.html.erb
Created January 7, 2011 19:48
Error Messages Partial
<%= flash.each do |key,value| %>
<div class="flash <%= key %> span-22 last prepend-1">
<%= value %>
</div>
<% end %>
@hwrdprkns
hwrdprkns / XMLParser.java
Created March 25, 2011 01:57
MyLovleyXMLParser
public URLRead(URL url) {
BufferedReader reader;
awl = new ArrayList<AptWrapper>();
Log.d(TAG,url.toExternalForm());
try {
reader = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
boolean flag = false;
error_flag = false;
while ((str = reader.readLine()) != null && error_flag == false) {
@hwrdprkns
hwrdprkns / AppRater.java
Created May 19, 2011 13:49
AndroidRateApp Snippet
public class AppRater {
private final static String APP_TITLE = "YOUR-APP-NAME";
private final static String APP_PNAME = "YOUR-PACKAGE-NAME";
private final static int DAYS_UNTIL_PROMPT = 3;
private final static int LAUNCHES_UNTIL_PROMPT = 7;
public static void app_launched(Context mContext) {
SharedPreferences prefs = mContext.getSharedPreferences("apprater", 0);
if (prefs.getBoolean("dontshowagain", false)) { return ; }
@hwrdprkns
hwrdprkns / BuildOrder1
Created May 26, 2011 23:29
Starcraft2ProtossCookieCutter
9 Pylon
10 Queue up 3 Probes and Chrono Boost their production twice in a row.
13 Gateway
14 1st Vespine Gas
16 Pylon
18 Cybernetics Core
18 2nd Vespine Gas
19 Zealot (GET ZEALOT BEFORE CYBERNETICS CORE IF YOUR OPPONENT MIGHT BE AGGRESSIVE)
23 Research Warp Gates
23 Zealot
@hwrdprkns
hwrdprkns / WebImageGallery.java
Created June 1, 2011 20:32
BitmapScalingAndroid
private Drawable LoadThumbnailFromURL(String url) {
if(downloader.getBitmapFromCache(url) != null){
Bitmap b = downloader.getBitmapFromCache(url);
//HERE IS WHERE I WANT TO SCALE THE IMAGE IF ITS IN THE CACHE
}
try {
URLConnection connection = new URL(url).openConnection();
String contentType = connection.getHeaderField("Content-Type");
@hwrdprkns
hwrdprkns / BitCoin.txt
Created June 25, 2011 14:08
My Bitcoin Address
1AqYrZijbENBSQSyLbsRAGUwbstsvKBg95
@hwrdprkns
hwrdprkns / errorLog.txt
Created August 8, 2011 14:39
Apple Error Log
Process: Xcode [1060]
Path: /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 4.1 (516)
Build Info: IDEApplication-516000000000000~18
Code Type: X86-64 (Native)
Parent Process: launchd [173]
Date/Time: 2011-08-08 10:24:33.663 -0400
OS Version: Mac OS X 10.7 (11A511)
@hwrdprkns
hwrdprkns / dabbutHax.js
Created November 14, 2011 07:44 — forked from erikformella/dabbutHax.js
dick move
/*
USAGE:
copy and paste all of this into the javascript console. you can then call falseVote(ians_comment_id, times) to upvote
ian as partygoer times times. you can also provide your own comment_id by doing an inspect element on the voting div
on anyone's profile.
the ajax requests are synchronous to allow for the coockie bs. this makes the execution seem slow for large times.
i wonder how long it takes to run it for thousands of iterations...
*/