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
// Call this function in the onComplete callback of the SwaggerUi constructor | |
var cleanSwaggerModelIds = function() { | |
var startTime = new Date(); | |
var modelIdRegex = /^(GET|POST|PUT|PATCH|DELETE)_([^\/]+).*?( \{)?$/; | |
var arrayDeclRegex = /^Array\[(GET|POST|PUT|PATCH|DELETE)_([^\/]+)\/.*\]/; | |
var elementsWithModelIds = $('.model-signature .description span.strong, .model-signature .description span.propType'); | |
elementsWithModelIds.each(function (index, e) { | |
var elem = $(e); | |
var shortModelId; | |
var newText; |
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 XCTest | |
func NSCalendarForTesting() -> NSCalendar { | |
let calendar = NSCalendar(calendarIdentifier: NSGregorianCalendar)! | |
calendar.timeZone = NSTimeZone(name: "America/New_York")! | |
calendar.firstWeekday = 2 // Monday | |
return calendar | |
} | |
class NSCalendarTests: XCTestCase { |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using ServiceStack; | |
namespace AddSsRefHost.ServiceModel | |
{ | |
[Route("/hello/{Name}")] | |
public class Hello : IReturn<HelloResponse> |
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
set -e # http://stackoverflow.com/q/2870992/795339 | |
podname=<TODO:NAME> | |
version=$(grep s.version $podname.podspec | head -1 | cut -d = -f 2 | cut -d '"' -f 2) | |
poddir=<TODO:ROOT DIRECTORY OF YOUR LOCAL PODS REPO>/$podname/$version | |
# This should print without any quote characters. Otherwise the script will break. | |
echo "Publishing $podname release $version..." | |
echo "The podspec file should be updated with a new version number. Going to commit." |
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
{ "sample": this is bogus } |
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 <UIKit/UIKit.h> | |
@interface MMViewController : UIViewController | |
@property (nonatomic, weak) IBOutlet UIView *colorView; | |
@property (nonatomic, weak) IBOutlet UILabel *hLabel; | |
@property (nonatomic, weak) IBOutlet UILabel *sLabel; | |
@property (nonatomic, weak) IBOutlet UILabel *bLabel; |
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
// the entity you want to validate | |
public class Person | |
{ | |
public int Age { get; set; } | |
public string Name { get; set; } | |
} | |
public class ValidationFailure | |
{ | |
public ValidationFailure(string description) { Description = description; } |
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
internal interface IFallbackRegistrationProvider | |
{ | |
bool TryRegister(Type registerType, TinyIoCContainer container); | |
} | |
internal sealed class TinyIoCContainer : IDisposable | |
{ | |
public IFallbackRegistrationProvider FallbackRegistrationProvider { get; set; } | |
private class NullFallbackRegistrationProvider : IFallbackRegistrationProvider | |
{ |
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 TestClass1 : NSObject | |
+ (NSString *)getSomeString; | |
- (NSString *)doSomething; | |
- (NSString *)doSomethingElse; | |
@end | |
@interface TestClass1 (TestClass1Catgegory) | |
+ (NSString *)ext_getSomeString:(NSString *)input; | |
@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
public class MySpec : Spec<SomeClass> | |
{ | |
protected override void BeforeEachExample() | |
{ | |
} | |
protected override void AfterEachExample() | |
{ | |
} | |