Skip to content

Instantly share code, notes, and snippets.

// class CountDownEvent {
// init(endDate: NSDate, name: String);
// }
extension CountDownEvent: NSSecureCoding {
convenience init(coder: NSCoder!) {
let endDate = coder.decodeObjectOfClass(NSDate.classForCoder(), forKey: "endDate") as NSDate
let name = coder.decodeObjectOfClass(NSString.classForCoder(), forKey: "name") as NSString
self.init(endDate: endDate, name: name) // Is this not how you call another initializer?

Keybase proof

I hereby claim:

  • I am axiixc on github.
  • I am axiixc (https://keybase.io/axiixc) on keybase.
  • I have a public key whose fingerprint is 37A6 BB5F 25ED F824 9B66 7BF8 B907 7DAB 7DF3 DEE3

To claim this, I am signing this object:

@axiixc
axiixc / editor.html
Created August 18, 2013 08:05
Just a little something I'm working on…
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
html {
height: 100%;
overflow-y: hidden; }
body {
background: #dfdfdf;
@axiixc
axiixc / assemble.rb
Created April 22, 2013 14:38
Basic ruby assembler for a microprocessors project
#!/usr/bin/ruby
# Expectations:
# 1) File contains only hardware instructions, there is NO pseudoinstruction translation
# 2) All immediates are the correct size. The assembler will generate errors and cease
# code generation, but will not convert large immediates to $at.
# 3) Labels must be on a line by themselves. If an instruction follows a label it will
# cause undefined errors in assembly!
# 4) All comments must be denoted by a hash (#) symbol. They may appear anywhere in the
# program, and anything after the hash will be dropped from the instruction parsing.
@axiixc
axiixc / MyClass.h
Last active December 16, 2015 09:49
@interface MyClass : NSObject
@property (nonatomic, strong) NSComplexThing * myThing;
@end
@axiixc
axiixc / example-send-assignment.sh
Created April 20, 2012 01:28
Send assignments to the PLC grading server. Only tested for students.
#!/bin/bash
echo "Zipping assignment..."
zip assignment.zip file1.ss file2.ss file3.ss main.ss >> /dev/null
if [ $? -eq 0 ]
then
plcsend --send-file assignment.zip -user YOUR_USERNAME -pass YOUR_PASSWORD -id ASSIGNMENT_ID
else
echo "Error creating zip"
fi
@axiixc
axiixc / reloader.ss
Created March 10, 2012 20:16
Automatically reload files loaded using (rl-load <filename>)
;;; James Savage -- http://axiixc.com
;;; Easy file reloading for scheme, written because I needed it.
;;; The list of all reloadable files
(define rl-files (list))
(define rl-last-file '())
;;; Clear any reloadable files
(define rl-clear (lambda ()
(set! rl-files (list))
@axiixc
axiixc / ax-ut.ss
Created March 7, 2012 05:43
Attempting to learn Scheme, and what better way than by writing code to test my other code :P
(define test-base
(lambda (passed? result message)
(if passed?
(begin
(display " passed: ")
(display message)
)
(begin
(display " failed: ")
(display message)
@axiixc
axiixc / example_config.yaml
Created November 11, 2011 22:07
A quick-and-dirty CSS generator. Basically takes a file an does some text replacements, but allows you to use constants and blocks in your css.
---
:definitions:
MAIN_BG: white
MAIN_TEXT_COLOR: black
MAIN_LINK_COLOR: black
MAIN_LINK_HIGHLIGHT_COLOR: "#FF0"
:partials:
MASTHEAD_GRADIENT: |
background: rgb(40,40,40);
@axiixc
axiixc / asym.rb
Created November 10, 2011 02:03
A ruby assembler for our totally awesome processor. Also with almost no error handling.
#!/bin/ruby
# Expectations:
# 1) File contains only hardware instructions, there is NO pseudoinstruction translation
# 2) All immediates are the correct size. The assembler will generate errors and cease
# code generation, but will not convert large immediates to $at.
# 3) Labels must be on a line by themselves. If an instruction follows a label it will
# cause undefined errors in assembly!
# 4) All comments must be denoted by a hash (#) symbol. They may appear anywhere in the
# program, and anything after the hash will be dropped from the instruction parsing.