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
/// Makes testings dictionaries berable in Swift. It correctly tests heterogenous dictionaries | |
/// | |
/// E.g.: | |
/// let expected: [String: Any] = ["p": true] | |
/// let actual = doSomething() // returns [String: Any] | |
/// XCTAssertEqual(actual, expected) | |
/// | |
public func XCTAssertEqual<K, V>(_ expression1: @autoclosure () throws -> [K: V], _ expression2: @autoclosure () throws -> [K: V], _ message: @autoclosure () -> String? = nil, file: StaticString = #file, line: UInt = #line) { | |
do { | |
let lhs = try expression1() as NSDictionary |
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 <Foundation/Foundation.h> | |
/* How To Enable CrashlyticsAdapter | |
* | |
* # On the App Target | |
* | |
* Initialize Crashlytics as usual and pass the real Crashlytics instance to the adapter: | |
* | |
* [Fabric with:@[[Crashlytics class]]]; | |
* [CrashlyticsAdapter with:[Crashlytics sharedInstance]]; |
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
$('#files_bucket .file').each(function() { | |
var fileDiff = $(this).children('.data, .image') | |
var fileNameSpan = $(this).find('.info > .js-selectable-text').first() | |
var fileName = fileNameSpan.attr('title') | |
var filter = /Pods/ | |
if (filter.test(fileName)) { | |
fileDiff.hide() | |
} | |
}); |
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 urllib2 | |
from HTMLParser import HTMLParser | |
import xml.etree.ElementTree as ET | |
class UrbanDictionaryHTMLParser(HTMLParser): | |
def __init__(self): | |
HTMLParser.__init__(self) | |
self.is_parsing_entries = False | |
self.definitions = [] | |
self.is_word_open = False |
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
# AppDelegate.m | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
UIViewController *rootController = [[UIStoryBoard storyboardWithName:@"MainStoryBoard" bundle:nil] instantiateInitialViewController]; | |
PPRevealSideViewController *revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:rootController]; | |
self.window.rootViewController = _revealSideViewController; | |
[window makeKeyAndVisible]; | |
return YES; |
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
@implementation DatabaseConnection | |
static DatabaseConnection *connection; | |
+ (DatabaseConnection *)connection; | |
{ | |
return connection; | |
} | |
+ (void)setConnection:(DatabaseConnection *)newConnection; |
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
#! /bin/bash | |
# Fix git-svn on Mountain Lion | |
# Author: Felipe Cypriano <[email protected]≥ | |
# Based on Vitor Quinn blog post: | |
# http://victorquinn.com/blog/2012/02/19/fix-git-svn-in-mountain-lion/ | |
# If you do not have xcode-select pointing to the right Xcode installation | |
# put the right path in the line bellow and uncoment it | |
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer |
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
# encoding: utf-8 | |
class OperationsController < ApplicationController | |
respond_to :json | |
rescue_from ActiveRecord::RecordNotFound, :with => :not_found | |
def show | |
operation = Operation.find(params[:id]) | |
respond_with operation | |
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
# Objective-C Syntax Highliht for Atlassian Fisheye and Crucible | |
# Based on Atlassian's C syntax highlight | |
# Author: Felipe Cypriano <[email protected]> | |
# Copyright 2010 Felipe Cypriano | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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
apply plugin: 'groovy' | |
sourceCompatibility = 1.5 | |
version = '0.1-SNAPSHOT' | |
repositories { | |
mavenRepo(urls: 'http://repository.codehaus.org/') | |
mavenCentral() | |
} |
NewerOlder