Skip to content

Instantly share code, notes, and snippets.

View raphaelmor's full-sized avatar

Raphaël Mor raphaelmor

View GitHub Profile
@raphaelmor
raphaelmor / styleguide.md
Created May 25, 2011 09:39
Code style guide

#Objective-C Style Guide ##Comments ###General Info Block comments /**/ should be avoided in favor of // (though they are not banned).

Inside comments, references to variables, classes and protocols should be surrounded by |.

// This class is responsible for keeping up to date a list of |Item| objects.
@raphaelmor
raphaelmor / checkstyleRules.md
Created May 25, 2011 13:57
Rules for an Objective-C checkstyle tool

#Formating options for .h / .m

##File

###Rules

  • No EmptyLine at begining of file
  • No EmptyLine at end of file
  • Must start with FileCommentBlock
  • Must end with @end
@raphaelmor
raphaelmor / clanglib.c
Created July 20, 2012 13:57
clanglib usage example
#include <iostream>
#include <clang-c/Index.h>
#include <clang-c/Platform.h>
void printDiagnostics(CXTranslationUnit translationUnit);
void printTokenInfo(CXTranslationUnit translationUnit,CXToken currentToken);
void printCursorTokens(CXTranslationUnit translationUnit,CXCursor currentCursor);
CXChildVisitResult cursorVisitor(CXCursor cursor, CXCursor parent, CXClientData client_data);
@raphaelmor
raphaelmor / .travis.yml
Last active August 29, 2015 14:04
Basic Travis Configuration File
language: objective-c
before_script:
- export LANG=en_US.UTF-8
script:
- xctool -workspace MZTD.xcworkspace -scheme MZTD -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
- xctool test -workspace MZTD.xcworkspace -scheme MZTD -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
@raphaelmor
raphaelmor / .travis.yml
Created July 22, 2014 16:50
Travis Configuration File for Code Coverage
language: objective-c
before_script:
- export LANG=en_US.UTF-8
script:
- xctool -workspace MZTD.xcworkspace -scheme MZTD -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
- xctool test -workspace MZTD.xcworkspace -scheme MZTD-Coverage -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
@raphaelmor
raphaelmor / .travis.yml
Created July 22, 2014 16:57
Final Travis Configuration File
language: objective-c
before_script:
- export LANG=en_US.UTF-8
script:
- xctool -workspace MZTD.xcworkspace -scheme MZTD -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
- xctool test -workspace MZTD.xcworkspace -scheme MZTD-Coverage -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
before_install:
- sudo easy_install cpp-coveralls
after_success:
- ./coveralls.rb --extension m --exclude-folder MZTDTests
public init?(json: JSON) {
let optCoord = json["coordinates"]
let opt = optCoord.array?.map { jsonLineString in
jsonLineString.array?.map { jsonPosition in
jsonPosition.array?.map {
Double($0.doubleValue)
} ?? []
} ?? []
}
@raphaelmor
raphaelmor / Mocks.swift
Created January 19, 2015 17:12
Who said we don't need mocks in Swift...
class MockDataSource : TransporterDataSource {
var startUpdatingLocationCalled = 0
var stopUpdatingLocationCalled = 0
func startUpdatingLocation() {
startUpdatingLocationCalled++
}
func stopUpdatingLocation() {
stopUpdatingLocationCalled++
# The definition of color schemes.
schemes:
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
primary:
background: '0x1d2021'
foreground: '0xd4be98'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'