This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :rails do | |
desc 'Execute rails console' | |
task :console do | |
on roles(:app) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
_execute_interactive(:bundle, :exec, :rails, :console) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
namespace :check do | |
task :linked_files => 'config/database.yml' | |
end | |
end | |
remote_file 'config/database.yml' => '/tmp/database.yml', roles: :app | |
file '/tmp/database.yml' do |t| | |
default_template = <<-EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report { n.times { nil.to_s } } | |
x.report { n.times { "#{nil}" } } | |
end | |
# user system total real | |
# 0.020000 0.000000 0.020000 ( 0.027392) | |
# 0.040000 0.000000 0.040000 ( 0.041352) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(count) | |
result = nil | |
count.downto(0).each do |j| | |
i = count - j | |
if j == count && j % 3 == 0 | |
result = Array.new(j, 5) | |
elsif i % 5 == 0 && j % 3 == 0 | |
result = Array.new(j, 5) + Array.new(i, 3) | |
elsif i == count && i % 5 == 0 | |
result = Array.new(i, 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE template SYSTEM "../../../project-config.dtd"> | |
<template> | |
<name>Rails</name> | |
<settings> | |
<options> | |
<option name="executionTimeoutMin" value="20" /> | |
</options> | |
<parameters> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Motion::Project::App.setup do |app| | |
# Find Provising profile depends on Profile name | |
# https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/template/ios/config.rb#L88 | |
app.provisioning_profile('IOS Wildcard Team Profile') | |
#or use same as app name | |
app.provisioning_profile(app.name) | |
# ... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Motion::Project::App.setup do |app| | |
#Simple example to generate a pretty build version | |
app.version = `git log -n 1 --pretty=format:'%h'`.upcase | |
app.short_version = '1.0' | |
#... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function info_kill() { | |
local frame=0 | |
while caller $frame; do | |
((frame++)); | |
done | |
echo "kill $*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem: --no-rdoc --no-ri |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="aussiegeek" | |
# Example aliases |