Skip to content

Instantly share code, notes, and snippets.

View benjgorman's full-sized avatar
🏄‍♂️

Benjamin Gorman benjgorman

🏄‍♂️
View GitHub Profile
@benjgorman
benjgorman / followLoad
Created February 23, 2011 17:34
The JSON returns fine however when this.Following has the value of "true"(string) and then comparing it to test 2, the else statement is called. Can you see any reason why?
$(function() {followLoad();});
function followLoad ()
{
$.getJSON("/Twitzer/Author/<%=Author.getuserName()%>/json", function(json)
{
var test="true";
var test2=this.Following;
if (test2==test)
{
@benjgorman
benjgorman / adialog.java
Created September 26, 2011 22:14
Android Dialog
final Button button6 = (Button) findViewById(R.id.btn_addRAddress);
button6.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
Context mContext = v.getContext();
final Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.add_address);
dialog.setTitle("Add Address");
@benjgorman
benjgorman / DoubleBoxSpinSpaceNormals.c
Created October 17, 2011 14:15
Two spinning OpenGl Cubes.
#include <stdlib.h>
#include <gl/freeglut.h>
GLfloat angle = 0.0;
void cube(void) {
//front
glColor3f(1.0,0.0,0.0);
@benjgorman
benjgorman / error.rb
Created November 23, 2011 22:38
Errors
def validate_card
unless credit_card.valid?
credit_card.errors.full_messages.each do |message|
# errors.add_to_base message
self.errors[:base] << message
end
end
end