Skip to content

Instantly share code, notes, and snippets.

View jquave's full-sized avatar
✔️
jquave

Jameson Quave jquave

✔️
jquave
View GitHub Profile
@jquave
jquave / cellForRowAtIndexPath function in jamesonquave.com tutorial
Created June 4, 2014 18:04
cellForRowAtIndexPath function in jamesonquave.com tutorial
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier)
}
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary
// Add a check to make sure this exists
@jquave
jquave / cellForRowAtIndexPath function in jamesonquave.com tutorial
Created June 4, 2014 17:20
cellForRowAtIndexPath function in jamesonquave.com tutorial
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier)
}
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary
// Add a check to make sure this exists
@jquave
jquave / cellForRowAtIndexPath function in jamesonquave.com tutorial
Created June 4, 2014 17:09
cellForRowAtIndexPath function in jamesonquave.com tutorial
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier)
}
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary
// Add a check to make sure this exists
@jquave
jquave / jamesonquave.com comment reply
Created June 3, 2014 01:05
jamesonquave.com comment reply
import UIKit
class AnotherClass {
var someVar = 1
let someConst = 2
func somePrivateFunc() -> Bool {
return true
}
@jquave
jquave / Swift Part 2 jamesonquave.com
Created June 3, 2014 00:37
Part 2 of the Swift tutorial at jamesonquave.com
//
// ViewController.swift
// TestSwift
//
// Created by Jameson Quave on 6/2/14.
// Copyright (c) 2014 JQ Software LLC. All rights reserved.
//
import UIKit
@jquave
jquave / SwiftTable
Created June 2, 2014 20:58
Example code for Table View in Swift
import UIKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
jquave@Jamesons-iMac:~/Code/FlatSquishies/Dictionary$ ./clean.rb
Ignoring word bitch because it's profane
Ignoring word bldg because it's not a word
Ignoring word cc because it's not a word
Ignoring word cm because it's not a word
Ignoring word coon because it's profane
Ignoring word db because it's not a word
Ignoring word dick because it's profane
Ignoring word f's because it's not a word
Ignoring word ft because it's not a word
using UnityEngine;
using System.Collections;
using System.Reflection;
public class BlockColors {
Color wall = new Color(0,0,0);
Color enemySpawner = new Color(255,0,0);
Color floor = new Color(0, 255, 255);
Color spawnPoint = new Color(0, 255, 0);
Color goal = new Color(255, 255, 0);
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public int metal = 200;
public int hp = 100;
QInput input;
public GameObject sentryPrefab;
float groundDist = 0.62f;
using UnityEngine;
using System.Collections;
public class Enemy : MonoBehaviour {
public int hp = 5;
public GameObject dropPrefab;
public GameObject heartPrefab;
int maxWalkSpeed = 3;
int direction = 3;