Skip to content

Instantly share code, notes, and snippets.

class Agent < ActiveRecord::Base
self.table_name = "agtAgents"
self.primary_key = "agentID"
#has_one :corporation, :class_name => "NPCCorporation", :foreign_key => "corporationID"
belongs_to :inv_name, :foreign_key => "agentID"
def name
return self.inv_name.to_s
end
end
class BlueprintComponent < ActiveRecord::Base
self.table_name = "industryActivityMaterials"
self.primary_key = "typeID"
belongs_to :blueprint, :foreign_key => 'typeID'
belongs_to :item, :class_name => 'Item', :foreign_key => 'materialTypeID'
end
//
// MusicStaffViewStaffLayer.swift
// MusicStaffView
//
// Created by Mike Muszynski on 1/4/15.
// Copyright (c) 2015 Mike Muszynski. All rights reserved.
//
import UIKit
class AppDelegate: NSObject, NSApplicationDelegate {
let menu = NSMenu()
var statusItem: NSStatusItem!
var settingsWindowController = NSWindowController(windowNibName: "ControlPanelWindowController")
func openSettingsWindow() {
settingsWindowController.showWindow(self)
settingsWindowController.window?.orderFront(self)
}
@mmuszynski
mmuszynski / erase.swift
Created June 11, 2016 16:59 — forked from seivan/erase.swift
try this
easier:
func && (lhs: Chainable, rhs: Chainable) -> [Chainable] {
return [lhs, SQLiteChainType.And, rhs]
}
protocol Landmarkable {
var coordinate: CLLocation? { get } //classes must provide at least a Read-Only location called "coordinate"
func distanceFrom(location: CLLocation) -> CLLocationDistance //classes must provide a distance from another location
}
protocol Outlineable: Landmarkable {
var outline: [CLLocation]? { get } //must provide an outline represented by an array of locations
var center: CLLocation? { get } //must provide a center location
}
//Attempting to load the view of a view controller while it is deallocating
//is not allowed and may result in undefined behavior (<UIAlertController: 0x7f8ec04a27a0>)
//(wait alert is the one that it is complaining about)
@IBAction func addLandmarkWithSelectedType() {
let waitAlert = UIAlertController(title: "Waiting for accuracy", message: "Holding until the accuracy improves", preferredStyle: .Alert)
let timeoutAlert = UIAlertController(title: "Location Manager Error!", message: "Location manager was not able to provide the necessary accuracy", preferredStyle: .Alert)
let cancelTimeoutAlert = { (action: UIAlertAction) in self.dismissViewControllerAnimated(true, completion: nil) }
timeoutAlert.addAction(UIAlertAction(title: "Drat", style: .Cancel, handler: cancelTimeoutAlert))
//Intervals
let C0 = MusicPitch(name: .c, accidental: .natural, octave: 0)
let D0 = MusicPitch(name: .d, accidental: .natural, octave: 0)
let majorSecond = try MusicInterval(rootPitch: C0, destinationPitch: D0)
XCTAssertEqual(majorSecond.halfStepDistance, 2)
XCTAssertEqual(majorSecond.quality, MusicIntervalQuality.major)
XCTAssertEqual(majorSecond.quantity, MusicIntervalQuantity.second)
//Scales
BSNDataController.m
-(NSMutableArray*)fetchFingeringsForNoteObject:(Note*)noteObject {
//slightly different, pulls the fingerings for a note OBJECT
//NSLog(@"Fetching fingering for note object with name: %@", noteObject.name);
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Fingering" inManagedObjectContext:[self managedObjectContext]];
//
// ViewController.swift
// RLMessageBlaster
//
// Created by Mike Muszynski on 10/14/17.
// Copyright © 2017 Mike Muszynski. All rights reserved.
//
import Cocoa