Skip to content

Instantly share code, notes, and snippets.

#import "Foo.h"
@interface SomeClass : NSObject
- (id)init UNAVAILABLE_ATTRIBUTE;
- (id)initWithFoo:(id<Foo>)foo;
@end
@marksands
marksands / UIKeyboardImpl.h
Created May 26, 2014 23:48
UIKeyboardImp
<UIKeyboardImpl: 0xd6cbe0>:
in UIKeyboardImpl:
Class Methods:
+ (void) applicationDidReceiveMemoryWarning:(id)arg1; (0x4136a6)
+ (void) applicationWillResignActive:(id)arg1; (0x413565)
+ (void) applicationDidEnterBackground:(id)arg1; (0x413626)
+ (void) applicationWillEnterForeground:(id)arg1; (0x413663)
+ (void) applicationWillSuspend:(id)arg1; (0x413431)
+ (id) activeInstance; (0x41332f)
+ (void) releaseSharedInstance; (0x413340)
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
@interface NSDecimalNumberTests : XCTestCase
@end
@implementation DecimalTests
@marksands
marksands / LOLClass.h
Created February 10, 2015 17:31
Testing against strong delegates
#import <UIkit/UIKit.h>
@protocol LOLDelegate
@end
@interface LOLClass : NSObject <LOLDelegate>
@property (nonatomic) id<LOLDelegate> strongDelegate;
@end
@marksands
marksands / am_i_debugged.m
Last active August 29, 2015 14:16
Block Debugger
#include <assert.h>
#include <stdbool.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/sysctl.h>
static bool AmIBeingDebugged(void)
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
{
#include <iostream>
#include <iomanip>
#include <string>
#include "BST.h"
#include "SearchableADT.h"
void ShowStats( SearchableADT<string>*& dictionary );
int main( int argc, char* argv[] )
{
// File: p06.cpp
// Name: Mark Sands
// Date: 12/02/08
// Course: CS 240 - Introduction to Computing III
// Desc: This program demonstrates a Binary Search Tree with the ability to index by
// a static key value in order to sort, display, and remove in a robust manner.
//
// Other files required: IndexedBST.h, IndexedBST.cpp
//------------------------------------------------------------------------------------------
#!/usr/bin/python
# Program to convert a number into the format
# hh mm ss.sssss
# Input format: ./converter.py DEC RA
import math
import sys
import string
def to_dec(inp):
#!/usr/bin/python
#
# Program to convert a number into the format
# hh mm ss.sssss
# Input format: ./ToDecRa.py DEC RA
#
# test data: 63.36130383 256.99567542
import math
#include <iostream>
#include <string>
inline std::istream& operator >>(std::ostream& os, std::string &arg) { return (std::cin >> arg); }
inline std::ostream& operator <<(std::istream& is, std::ostream& (*_T)(std::ostream&)){ return (std::cout << _T); }
int main()
{
std::string name;
std::cout << "Name? " >> name << std::endl;