Skip to content

Instantly share code, notes, and snippets.

View netbe's full-sized avatar

François Benaiteau netbe

View GitHub Profile
@netbe
netbe / gist:3f65c537775007c3e1a6
Created December 18, 2014 10:33
generate man pages ruby
task :man do
mkdir_p "build"
File.write "README.md.ron", File.read("README.md").gsub("\u200c", "* ")
sh 'ronn --roff --manual="Gist manual" README.md.ron'
rm 'README.md.ron'
mv 'README.1', 'build/gist.1'
end
# https://github.com/defunkt/gist/blob/master/Rakefile
@netbe
netbe / metajson.rb
Last active August 29, 2015 14:01
metajson.rb
require "formula"
class Metajson < Formula
homepage "https://github.com/sinnerschrader-mobile/metaJSON."
head "https://github.com/sinnerschrader-mobile/metaJSON.git", :branch => 'feature/refactor'
depends_on :python
def install
system "python", "setup.py", "build"
system "python", "setup.py", "install"
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"
@netbe
netbe / gist:7779087
Last active December 30, 2015 04:59
diff after xcodeproj process
diff --git a/orientation.xcodeproj/project.pbxproj b/orientation.xcodeproj/project.pbxproj
index 9e55528..06f6942 100644
--- a/orientation.xcodeproj/project.pbxproj
+++ b/orientation.xcodeproj/project.pbxproj
@@ -1,491 +1,1159 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
KEYWORDS="TODO:|FIXME:|OPTIM:|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
@netbe
netbe / .gitattributes
Last active December 27, 2015 19:39
template for gitattributes xcode project
*.strings diff=localizablestrings
*.pbxproj string merge=union
# 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)
@netbe
netbe / runtests
Created July 9, 2013 08:30
script to run unit test from command line xcode + custom variables passed
if [ "$RUN_UNIT_TEST_WITH_IOS_SIM" = "YES" ]; then
test_bundle_path="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION"
ios-sim launch "$(dirname "$TEST_HOST")" \
--setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection \
--setenv XCInjectBundle="$test_bundle_path" \
--setenv RUN_TESTS=1 \
--setenv XCInjectBundleInto="$TEST_HOST" --args -SenTest All "$test_bundle_path"
echo "Finished running tests with ios-sim"
else
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
# 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/