This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIImageView (highlighted) | |
@property (nonatomic, strong) NSMutableDictionary *highlightedKV; | |
@property (nonatomic, strong) NSMutableDictionary *unhighlightedKV; | |
@end | |
@implementation UIImageView (highlighted) | |
-(NSMutableDictionary *)highlightedKV { | |
id returnValue = objc_getAssociatedObject(self, "highlightedKVKey"); | |
if (!returnValue) { | |
returnValue = [NSMutableDictionary dictionary]; | |
[self setHighlightedKV:returnValue]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//More succinct (read hacky) way of making "Classes" in javascript. | |
//Use: | |
/* | |
Class({NewClass : Superclass}, [ | |
function methodOne() { | |
//do something | |
} | |
}); | |
then use in the usual javascript way: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Preferences/PSSwitchTableCell.h" | |
@interface JBPLinkSwitchCell : PSSwitchTableCell | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SomeRoads | |
{ | |
public class SomeRoadsLoader : LoadingExtensionBase | |
{ | |
public override void OnCreated(ILoading loading) | |
{ | |
InitMod(); | |
} | |
public override void OnLevelLoaded(LoadMode mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ICities; | |
using ColossalFramework; | |
using ColossalFramework.Globalization; | |
using ColossalFramework.IO; | |
using ColossalFramework.UI; | |
using ColossalFramework.Steamworks; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class A> struct Failable | |
{ | |
bool error; | |
A value; | |
wxString errorString; | |
Failable(wxString errorStr) : error(true), errorString(errorStr) {} | |
Failable(A val) : error(false), value(val) {} | |
operator A() const { return value; } | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Status: Int { | |
case Good | |
case Bad | |
} | |
// Status.RawValue == Int not NSData, therefore this extension should not be applied to status | |
extension RawRepresentable where RawValue == NSData, Self: NSCoding { | |
init?(rawValue: NSData) { | |
if let instance = NSKeyedUnarchiver.unarchiveObjectWithData(rawValue) as? Self { | |
self = instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public typealias Given = Step | |
public typealias When = Step | |
public typealias Then = Step | |
public typealias And = Step | |
public struct Step { | |
@discardableResult | |
public init(_ handler: @autoclosure () -> Void, file: String = #file, line lineNumber: Int = #line) { | |
step(handler, file: file, line: lineNumber) |