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
| mysqldump do | |
| options "-ceKq --single-transaction --create-options" | |
| username = "some" | |
| pass = "thing" | |
| user username | |
| password pass | |
| socket "/var/run/mysqld/mysqld.sock" |
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
| # More info at https://github.com/guard/guard#readme | |
| guard 'ego' do | |
| watch('Guardfile') | |
| end | |
| guard 'spork' do | |
| watch('config/application.rb') | |
| watch('config/environment.rb') | |
| watch(%r{^config/environments/.*\.rb$}) |
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 :db do | |
| desc "Reset all sequences. Run after data imports" | |
| task :reset_sequences, :model_class, :needs => :environment do |t, args| | |
| if args[:model_class] | |
| classes = Array(eval args[:model_class]) | |
| else | |
| puts "using all defined active_record models" | |
| classes = [] | |
| Dir.glob(RAILS_ROOT + '/app/models/**/*.rb').each { |file| require file } | |
| ActiveRecord::Base.subclasses.select { |c|c.base_class == c}.sort_by(&:name).each do |klass| |
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
| app_home = "/home/mi/production" | |
| workers = 5 | |
| Bluepill.application("mi_delayed_job", :log_file => "#{app_home}/shared/log/bluepill.log") do |app| | |
| (0...workers).each do |i| | |
| app.process("delayed_job.#{i}") do |process| | |
| process.working_dir = "#{app_home}/current" | |
| process.start_grace_time = 10.seconds | |
| process.stop_grace_time = 10.seconds | |
| process.restart_grace_time = 10.seconds |
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
| ## config/boot.rb | |
| # Place this snippet right above the "Rails.boot!" command at the bottom of the file. | |
| class Rails::Boot | |
| def run | |
| load_initializer | |
| extend_environment | |
| Rails::Initializer.run(:set_load_path) | |
| end | |
| def extend_environment |
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
| function log(object) { | |
| Ti.API.debug(object); | |
| if(logger) { | |
| logger.log(object); | |
| }; | |
| }; | |
| var indWin = null; | |
| var actInd = null; |
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
| // RATER MODULE for Appcelerator Titanium | |
| /* | |
| WHAT IS IT: | |
| Create a cycling reminder to go rate your app at the App Store. Tracks | |
| the app launch count, and reminds the user every 20 launches (configurable) to | |
| rate the app, with a click to launch the app page in the App Store. | |
| Reminders stop if the user clicks the "Rate Now" or "Don't Remind Me" options. | |
| USAGE: |
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
| (function() { | |
| App.Models.Task = App.Models.Base.createModel('Task', 'tasks', { | |
| name: 'TEXT', | |
| note: 'TEXT', | |
| due_at: 'DATE', | |
| is_completed: 'TEXT', | |
| completed_at: 'TEXT', | |
| category_id: 'TEXT', | |
| event_id: 'INTEGER', | |
| has_reminders: 'TEXT', |
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
| Robot-C is supported. Just FYI | |
| Has something called Task Control, up to 4 concurrent tasks, with priority... | |
| could do something like: | |
| StartTask(RaiseBasket, 10) | |
| StartTask(MoveToWallGoal, 10) | |
| To move to the goal and make sure the basket is Raised | |
| RaiseBasket |
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
| # Prompt Setup | |
| function minutes_since_last_commit { | |
| now=`date +%s` | |
| last_commit=`git log --pretty=format:'%at' -1` | |
| seconds_since_last_commit=$((now-last_commit)) | |
| minutes_since_last_commit=$((seconds_since_last_commit/60)) | |
| echo $minutes_since_last_commit | |
| } |