View pr-description-generator.js
/*
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![]()';}
})();
View setup_your_ios_projects_for_testing.md

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.

View Gemfile
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'
View creditcard.coffee
# 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
View prop.js
function prop(propName) {
return function(obj) {
var property = obj[propName];
if (typeof property === 'function') {
return property();
} else {
return property;
}
}
}
View node-server.js
require('http').Server(function (req, res) {
require('fs').createReadStream(__dirname + require('url').parse(req.url).pathname).pipe(res);
}).listen(9000);
View errorable.js
/**
* 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
View etc_init.d_bouncy
#!/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)
View tuesday_birthday.py
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))
View 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() {