Skip to content

Instantly share code, notes, and snippets.

View masylum's full-sized avatar
💅
Being fantastic

Pau Ramon Revilla masylum

💅
Being fantastic
View GitHub Profile
/*
Add this as bookmark in your browser and tap on the bookmark when your are creating a new PR.
Example: http://cl.ly/image/0D1k0d1W1R0Y/Screen%20Shot%202015-01-26%20at%203.57.30%20PM.png
*/
javascript:(function() {
var e = document.getElementById('pull_request_body');
if (e) {e.value +='#### :tophat: What? Why?\n\n\n#### :dart: What should QA test?\n\n\n#### :pushpin: Related tasks?\n\n\n#### :family: Dependencies?\n\n\n#### :clipboard: Subtasks\n- [x]\n- [ ]\n\n\n#### :ghost: GIF\n![]()';}
})();

Setup your iOS projects for testing

image

In other programming communities, like the Ruby one, developers are more aware of testing new components. Ensuring every component is tested is not common within the mobile appcommunity.

Fortunately, iOS developers have been working over the years to bring that culture to iOS too. The community is developing new libraries that use native ones allow you to write your tests with a fresh and more readable syntax. This has provided a big impulse and every day more and more developers ensure that expected behaviour in their apps is tested.

The Redbooth iOS Team we've been strongly influenced by the Ruby backend team and we decided to introduce testing into our development flow. Thanks to components like Cocoapods, Schemes and targets and some other tools, testing has become an essential part of development cycle.

@masylum
masylum / Gemfile
Last active August 29, 2015 13:59
Redbooth oauth example
source "https://rubygems.org"
gem "thin", "~> 1.6.1"
gem "sinatra", "~> 1.4.4"
gem "json", "~> 1.8.1"
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-redbooth'
@masylum
masylum / creditcard.coffee
Created May 11, 2012 13:37 — forked from jrom/creditcard.coffee
Credit Card number validation in Coffee Script
# Ported from https://github.com/jzaefferer/jquery-validation/blob/master/jquery.validate.js
creditcard = (value) ->
# accept only spaces, digits and dashes
if /[^0-9 \-]+/.test(value)
return false
nCheck = 0
nDigit = 0
bEven = false
@masylum
masylum / prop.js
Created May 11, 2012 09:50
Pseudo `&:foo` implementation in javascript
function prop(propName) {
return function(obj) {
var property = obj[propName];
if (typeof property === 'function') {
return property();
} else {
return property;
}
}
}
@masylum
masylum / node-server.js
Created February 2, 2012 14:32 — forked from jrom/node-server.js
Super simple node file server
require('http').Server(function (req, res) {
require('fs').createReadStream(__dirname + require('url').parse(req.url).pathname).pipe(res);
}).listen(9000);
@masylum
masylum / errorable.js
Created January 5, 2012 16:59
Errorable
/**
* Errorable
*
* Provides functionality to react when server-side validations fail.
* This module exports 4 methods than you can use on your views.
*
* - onError
* - onSuccess
* - addError
* - removeError
@masylum
masylum / etc_init.d_bouncy
Created December 8, 2011 14:31
bouncy init file
#!/bin/sh
DIR=/var/www/your_app
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NODE_PATH=/usr/local/lib/node_modules
BOUNCY = /usr/local/bin/bouncy
test -x $BOUNCY || exit 0
case $1 in
start)
@masylum
masylum / tuesday_birthday.py
Created December 2, 2011 16:00
The tuesday birthday problem
import random
print '''
You meet a man on the street and he says, "I have two children and one is a son born on a Tuesday."
What is the probability that the other child is also a son?
'''
def get_combinations():
children = ('s', 'd')
weekdays = tuple(range(1, 8))
@masylum
masylum / jader.js
Created December 1, 2011 16:31
jader.js
var dir = __dirname + '/app/templates/conversations'
, finder = require('findit').find(dir)
, fs = require('fs')
, _ = require('underscore')
, templates = {}
, num_templates = 0
, all_scanned = false
, jade = require('jade');
function startServer() {