Skip to content

Instantly share code, notes, and snippets.

@susanndelgado
susanndelgado / gist:5677669
Last active December 17, 2015 21:49
Love game is a project I put together for School - What it does is it takes two names and calculates it in two different ways against each other to reveal love matches. First it will calculate a percent in a not so mathematical way. The code will evaluate the number of times a letter appears in each name then move it to an array that will later …
function gameSetup(){
var trueLove= []; //used for calculation of the percent
var flamesOne= [];//used for flames values you
var flamesTwo= [];//user for flame values partner
//first person
var $youFname = $("#you input.fname").val();
var $youLname = $("#you input.lname").val();
var $youName= $youFname.toLowerCase()+$youLname.toLowerCase();
var youArray = $youName.split("");
@susanndelgado
susanndelgado / gist:5677554
Last active December 17, 2015 21:49
class created to handle sql queries to a database
<?php
class GeneralDAL {
// Instance variable
private $con = null;
private $tableName = '';
function __construct($url,$userid,$password,$databaseName, $tableName) {
@susanndelgado
susanndelgado / gist:5678079
Created May 30, 2013 14:04
Practicing Modular on my website
var SLIDER = (function(self){
function __init(){
//run self init stuff here
request();
_setKeys();
// console.log(_globals.slides);
}
@susanndelgado
susanndelgado / gist:6040887
Last active December 20, 2015 00:19
Revising a friends code to make it more reusable. This example uses a little bit of modular coding and a little bit of Parasitic Inheritance and Overriding Members concepts.
var ATTACKS = (function (self) {
var moveList = {
slam: {
name: "Slam",
power: 20,
physical: true,
magic: false,
atkdelay: 400,
atkhold: 0,
special: null
@susanndelgado
susanndelgado / gist:6040917
Last active December 20, 2015 00:19
Working on a game demo to test my JavaScript abilities. This example is not made cross-browser compatible as of yet. My major concern was to be able to create a rpg game with modular coding practices and later it the project turns out worth while I will make it more cross browser compatible and add additional enhancements as needed
var HERO = (function(self) {
function init() {
console.log('Hero exist!');
}
var _globals = {
name: 'hero',
source: 'hero.png',
width: 100,
height:100,