This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //setupusers | |
require_once 'login.php'; //login.php defines $db_hostname, $db_username, $db_password, $db_database | |
$db_server = mysql_connect($db_hostname, $db_username, $db_password); | |
if (!$db_server) die("Unable to connect to MySQL: " . mysql_error()); | |
mysql_select_db($db_database) | |
or die("Unable to select database: " . mysql_error()); | |
$salt1 = "qm&h*"; | |
$salt2 = "pg!@"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.shuffle = function shuffle(){ | |
var tempSlot; | |
var randomNumber; | |
for (var i = 0; i != this.length; i++){ | |
randomNumber = Math.floor(Math.random() * this.length); | |
tempSlot = this[i]; | |
this[i] = this[randomNumber]; | |
this[randomNumber] = tempSlot; | |
} | |
return this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import acm.program.*; | |
public class Caesar extends ConsoleProgram { | |
private char encryptChar (char ch, int key){ | |
if (Character.isUpperCase(ch)) { | |
return((char)('A' + ((ch - 'A' + key)%26))); | |
} | |
return ch; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import acm.program.*; | |
public class CatsInHats extends ConsoleProgram { | |
private boolean changeHat(boolean b){ //reverses the hat-having state of any cat that changeHat gets called on | |
if (b==true) { | |
return false}; | |
else return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: Desmond Rawls | |
Github: www.github.com/desmondrawls | |
Website: www.mycodinghoneymoon.dreamhosters.com | |
Blog: desmondrawls.github.io | |
Tagline: teaching rocketships to think like astronauts | |
photo: https://www.facebook.com/photo.php?fbid=10100196742148965&l=085e78340c | |
treehouse: https://teamtreehouse.com/desmondrawls | |
coderwall:https://coderwall.com/desmondrawls | |
codeschool: http://codeschool.com/users/desmondrawls | |
codecademy: http://www.codecademy.com/desmondrawls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
here, eat this (handing the alien a delicious pb & j) | |
ok now you figure it out | |
"If you want to build a ship, don't drum up the men to gather wood, divide the work, and give orders. Instead, teach them to yearn for the vast and endless sea" - Antoine de Saint-Exupery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--I chose to make DVD a format instead | |
--of the primary noun | |
CREATE TABLE movies_and_tv ( | |
id INTEGER PRIMARY KEY, | |
name TEXT, | |
year INTEGER, | |
rating TEXT | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE user ( | |
id INTEGER PRIMARY KEY, | |
address TEXT, | |
email TEXT, | |
phone INTEGER | |
); | |
CREATE TABLE listing ( | |
id INTEGER PRIMARY KEY, | |
property_type TEXT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE projects ( | |
id INTEGER PRIMARY KEY, | |
title TEXT, | |
category TEXT, | |
goal INTEGER, | |
start INTEGER, | |
end INTEGER | |
); | |
CREATE TABLE users ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jukebox.rb | |
class Jukebox | |
@@jukeboxes = {} | |
def initialize (name) | |
@@on = true | |
@name = name | |
@user_tracks = [] | |
@@jukeboxes[:name] = @user_tracks |
OlderNewer