Skip to content

Instantly share code, notes, and snippets.

View netbe's full-sized avatar

François Benaiteau netbe

View GitHub Profile
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi
if [ -f ~/.zshrc ]; then
source ~/.zshrc
fi
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
# based on https://gist.github.com/3349345
# Thanks, @alloy!
#
# To get your project ready for this, you'll have to create a scheme for your unit test project, make sure run is checked in
# the build step, and then delete the Test Host setting.
# Also, make sure you have the colored and open4 gems installed.
require 'rubygems'
require 'colored'
require 'pathname'
@netbe
netbe / databases.rake
Created November 14, 2012 18:09 — forked from ak47/databases.rake
Monkey patch activerecord-3.0.9/lib/active_record/railties/databases.rake enables parallel_tests to work on my PG Jenkins CI
# #{Rails.root}/lib/tasks/databases.rake
=begin
Monkey Patch
activerecord-3.0.9/lib/active_record/railties/databases.rake
clears obstinate stale PG session to get parallel_tests working
also, PG user must be superuser to use these low level PG functions
=end
def drop_database(config)
case config['adapter']
when /mysql/
@netbe
netbe / complex_iOS_build_script.sh
Created August 28, 2012 16:59 — forked from abury/complex_iOS_build_script.sh
An extended iOS build Script showing a range of functions
#!/bin/sh
# Extended iOS Build Script
# Written by Aron Bury, 29/11/2011
#==== Script Params =====
# App params
appname="AwesomeApp"
target_name="$appname"
sdk="iphoneos"
@netbe
netbe / .pryrc
Created July 5, 2012 13:26 — forked from olivierlacan/.pryrc
Pry configuraton
# switch default editor for pry to sublime text
Pry.config.editor = "sublime"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
file 'config/preinitializer.rb', <<-PRE
# Use bundled gems
begin
require File.expand_path('../../.bundle/environment', __FILE__)
rescue LoadError
# This setup deliberately requires that the application be locked.
# For an alternative, see http://gist.github.com/302406#file_preinitializer.rb
if File.exist?(File.expand_path('../../Gemfile.lock', __FILE__))
raise "Application is locked but not installed. Run `bundle install` and then try again."
else