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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
package generator | |
// This code is based on this stackoverflow answer:http://stackoverflow.com/questions/12458852/load-emf-model-instance-in-xtend | |
import org.eclipse.emf.common.util.URI | |
import org.eclipse.emf.ecore.resource.Resource | |
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | |
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | |
import org.eclipse.emf.ecore.EPackage |
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
// Manifest.mf | |
Require-Bundle: | |
com.google.guava, | |
com.google.inject;bundle-version="3.0.0", | |
org.eclipse.xtend.lib;bundle-version="2.7.2", | |
org.eclipse.emf.common;bundle-version="2.10.1", | |
org.eclipse.emf.ecore;bundle-version="2.10.1", | |
org.eclipse.emf.ecore.xmi;bundle-version="2.10.1", | |
org.eclipse.xtext.xbase.lib, | |
IFMLEditor;bundle-version="1.0.0" |
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
#pragma mark - Runtime Methods | |
- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { | |
for(NSObject *vElem in self.viewElements) { | |
if([vElem respondsToSelector:selector]){ | |
return [vElem methodSignatureForSelector:selector]; | |
} |
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
#! /usr/bin/env bash | |
# set -o xtrace | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
function error() { | |
local -r TAG="$1" |
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
#! /usr/bin/env bash | |
# | |
# This script acts as a wrapper of carthage and as such it will handle | |
# the same commands handled by carthage, doing aditional work in some | |
# cases (e.g bootstrap) and simply relaying the invokations to carthage | |
# in the others. | |
# | |
# Decorated Commands: | |
# - bootstrap: | |
# When invoking for the first time, the script will let Carthage run |
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 | |
private let logFile = "Library/Logs/\(Date().timeIntervalSince1970).log" | |
func log(_ message: String, file: String = #file, function: String = #function, line: Int = #line) { | |
let formattedMessage = "\(Date()) [\(URL(fileURLWithPath: file).lastPathComponent):\(function):\(line)] \(message)" | |
let task: Process = Process() | |
task.launchPath = "/bin/sh" | |
task.arguments = ["-c", "echo '\(formattedMessage)' >> '\(logFile)'"] | |
task.launch() |
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 | |
/*: | |
# Description | |
Can be used to intercept HTTP and HTTPS calls made | |
by the application and introduce custom logic: e.g: | |
logging, custom caching, etc. |
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 | |
// MARK: - | |
extension NSError { | |
func contains(domain: String, code: Int, checkUnderlyingErrors: Bool = true) -> Bool { | |
return first(withDomain: domain, code: code, checkUnderlyingErrors: checkUnderlyingErrors) != nil |
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 | |
// MARK: - | |
class FileReader: Sequence, IteratorProtocol { | |
// MARK: - Private Members | |
private let file: URL | |
private let delimiter: Data |