Skip to content

Instantly share code, notes, and snippets.

View richievos's full-sized avatar

Richie Vos richievos

View GitHub Profile

Currently the most useful Android bike computer app for training (especially interval training). The runner up is Wahoo Fitness, but Wahoo lacks the right views for power based training, and flakes out a lot. However, this app could use a bit of a user experience / design overhaul. The feature set is great, the way it's presented is a bit painful.

Pros:

  • integrates well with all the bluetooth sensors I have (heart rate, speed/cadence, power meter)
  • uploads to a wide assortment of sites out there (including strava and training peaks)
  • very customizable, I was able to make almost exactly the layout I want
  • so far seems reliable (just did a small ride however)
  • I'll have to get used to the Start Sensors vs start trip flow, but I think I might like that
  • ability to merge rides in the UI is an awesome feature
  • great that it can trigger calibration on power meters
require 'fileutils'
namespace :sprout do
desc "Fakes out sprout making it think your flex3sdk tool's exes are in your desired flex sdk path (FLEX_SDK_PATH)"
task :fake_flex_sdk do
sdk_cache = File.join(ENV['HOME'], '.sprouts', 'cache', 'sprout-flex3sdk-tool-3.3.0')
FileUtils.mkdir_p sdk_cache
FileUtils.touch(File.join(sdk_cache, 'flex_sdk_3.zip'))
FileUtils.ln_s ENV['FLEX_SDK_PATH'], File.join(sdk_cache, 'archive')
end
# Optional more complicated strat for the database.yml
require 'ftools'
namespace :config do
task :build do
File.mkdir_p temp_config_dir
# this is the place to hook after when creating a config file
end
task :update do
# upload contents of temp_config_dir to #{release_path}/config
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'json'
require 'yaml'
require 'highline/import'
require File.dirname(__FILE__) + '/../lib/coop/status'
cred_info = if File.exist?('config/coop-creds.yml')
YAML.load(File.read('config/coop-creds.yml'))
local_libraries = %w(restfulx random_project_one)
local_libraries_path = '~/workspace'
# this assumes you are dealing with something with the common gem format
# my_library/
# my_library/lib
# my_library/lib/my_library.rb
local_libraries.each do |library|
$: << "#{local_libraries_path}/#{library}/lib"
# sorry if this is confusing, but it's a rake task with an argument
task :setup_custom_symlinks, [:root_path] do |t, args|
require 'file_utils'
root_path = args.root_path
libraries = %w(restfulX ...)
vendor_dir = 'vendor/plugins'
FileUtils.mkdir_p vendor_dir
libraries.each do |library|
FileUtils.ln_s(File.join(root_path, library), File.join(vendor_dir, library)
module Capistrano
class Configuration
module Namespaces
def skippable_task(name, *args, &block)
task name, *args do
if find_servers_for_task(current_task).empty?
logger.info "skipping #{current_task.fully_qualified_name} since it matches no servers"
else
block.call
end
class CreatedContext
def p
Proc.new { |x| puts "proc: #{self.inspect} on #{x.inspect}"}
end
def l
lambda { |x| puts "lambda: #{self.inspect} on #{x.inspect}"}
end
end
AppTweeter = Struct.new(:status) do
class << self
def new_user(user)
update("#{user.name} just signed up!")
end
def update(status)
status = "[#{Rails.env}] #{status}" unless Rails.env.production?
Delayed::Job.enqueue AppTweeter.new(status)
end
require 'pp'
votes = {
"gus" => ["Colonel Panic", "Cigar Heroes"],
"shinji" => ["Bomb Squad","Taco Town"],
"nawara" => ["Colonel Panic", "Taco Town", "Danger!! Death Ray"],
"dodos" => [],
"richie" => ["Bomb Squad", "Death Ray", "Bomb Ray Death Squad"],
"colin" => ["Colonel Panic", "Taco Town"],
"joey" => ["Danger!! Death Ray", "Bomb Squad"]