Skip to content

Instantly share code, notes, and snippets.

View wjlafrance's full-sized avatar
🐶
Wondering if Github is becoming a social network.

William LaFrance wjlafrance

🐶
Wondering if Github is becoming a social network.
View GitHub Profile
/*
Create an account on a Flak server
Uses ivar's for server, serverKey, firstName, lastName, email and password
*/
- (BOOL) createAccount
{
NSLog(@"Trying to create account..");
// Server Key, First Name, Last Name, Email, Password, Password
static NSString *createUserFormat = @"{ \"key\": \"%@\", \"user\": { \"first_name\": \"%@\", \"last_name\": \"%@\", "
"\"email\": \"%@\", \"password\": \"%@\", \"password_confirmation\": \"%@\", \"time_zone\": \"Central Time (US & Canada)\" } }";
@wjlafrance
wjlafrance / gist:826639
Created February 14, 2011 21:56
Ant script for 112 project 1
<project default="main">
<target name="main" depends="clean, buildlabs, buildproj"></target>
<target name="clean">
<delete dir="classes" />
</target>
<target name="buildlabs">
<mkdir dir="classes" />
@wjlafrance
wjlafrance / gist:863422
Created March 10, 2011 01:42
Using a weird assignment / conditional
#import <stdio.h>
int main() {
int value = 0;
if (5 == (value = thisReturnsFive())) {
printf("It works!\n");
} else {
printf("It doesn't work!\n");
#import <AVFoundation/AVFoundation.h>
// Initialize the music player
rickroll = [[AVAudioPlayer alloc]
initWithContentsOfURL:[[NSBundle mainBundle]
URLForResource:@"Rickroll"
withExtension:@"mp3"]
error:nil];
// Play music for 300ms
body {
background-color: black;
color: white;
}
div {
padding: 1.5px;
border: 1px white solid;
}
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="StealthBot.css" />
<title>StealthBot 3 - TestUser @ Azeroth in Channel "Op x86" (Mockup)</title>
</head>
<body>
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
CALayer *myLayer = [[CALayer alloc] init];
myLayer.position = CGPointMake(50, 50);
myLayer.backgroundColor = [[UIColor greenColor] CGColor];
myLayer.frame = CGRectMake(50, 50, 50, 50);
/**
* Division Challenge - divide.c
* William LaFrance
* 2011 March 28
*/
#import <stdio.h>
#define null 0x0
out = File.open("/tmp/dougalisms", "w")
(1..50).to_a.each { | ism_id |
system ("curl dougalisms.com/#{ism_id} > /tmp/dougalism#{ism_id}")
if File.exists?("/tmp/dougalism#{ism_id}") then
f = File.open("/tmp/dougalism#{ism_id}", "r")
while (line = f.gets) do
if line =~ /8e8e8e/ and not line =~ /refresh for more/ then
#Create a file named project2.properties and place it into the projects/config directory.
#This file will contain entries for the following:
#The name of the author of the project
project.author.name=William LaFrance
#The email address of the author
[email protected]
#The course title
course.title=Java 112
#The course meeting days and times
course.section=MW230