This file contains 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
... | |
Android { | |
buildTypes { | |
debug { | |
buildConfigField("String", "API_SERVER", "\"http://10.0.2.2:3000/\"") | |
} | |
release { | |
buildConfigField("String", "API_SERVER", "\"https://www.prod.xxxx.xxx.xxx/\"") | |
isMinifyEnabled = false |
This file contains 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
module Dig | |
def dig(path,default=nil) | |
puts "Entering dig" | |
path.split(".").inject(self) do |l,k| | |
l.respond_to?(:keys) ? (l.to_hash[k] || l.to_hash[k.to_sym] || default):default | |
end | |
end | |
end | |
This file contains 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
ActiveRecord::Schema.define(version: 20170104013645) do | |
create_table "comments", force: :cascade do |t| | |
t.integer "stars" | |
t.string "review" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
t.index [nil, nil], name: "index_comments_on_commentable_type_and_commentable_id" | |
end |
This file contains 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 "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
This file contains 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
jblack@comet$ cat ~/.chef/knife.rb | grep -v "^#" | grep -v "digital_ocean_access_token" | |
current_dir = File.dirname(__FILE__) | |
log_level :info | |
log_location STDOUT | |
node_name "jblack" | |
client_key "#{current_dir}/jblack.pem" | |
validation_client_name "linuxguru-validator" | |
validation_key "#{current_dir}/linuxguru.chef-validator.pem" | |
chef_server_url "https://chef.linuxguru.net/organizations/linuxguru" | |
cache_type 'BasicFile' |
This file contains 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 'finite_machine' | |
require 'pp' | |
class StopLight < FiniteMachine::Definition | |
events { | |
initial :red | |
event :power_on, :off => :red | |
# event :power_off, :any => :off | |
event :power_off, [:on, :red, :green, :yellow] => :off | |
event :change, :red => :green |
This file contains 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
jblack@sirius:~/blog$ cat config/routes.rb | |
Rails.application.routes.draw do | |
get 'welcome/index' | |
# The priority is based upon order of creation: first created -> highest priority. | |
# See how all your routes lay out with "rake routes". | |
# You can have the root of your site routed with "root" | |
root 'welcome#index' |