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
users= | |
{ | |
username1="password", | |
username2="password", | |
} | |
realms= | |
{ | |
{ | |
name="My realm...", |
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
{ | |
"data": { | |
"current_condition": [ | |
{ | |
"cloudcover": "1", | |
"humidity": "54", | |
"observation_time": "10:14 AM", | |
"precipMM": "0.0", | |
"pressure": "1013", | |
"temp_C": "7", |
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
# encoding: utf-8 | |
require "fileutils" | |
img=Dir.glob("**/*.jpeg")+Dir.glob("**/*.jpg")+Dir.glob("**/*.png")+Dir.glob("**/*.gif") | |
data=Dir.glob("**/*.htm*")+Dir.glob("**/*.css*")+Dir.glob("**/*.js*") | |
puts img.length.to_s+" images found & "+data.length.to_s+" files found to search against" | |
content="" |
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
class AddIndexesToTables1 < ActiveRecord::Migration | |
def change | |
add_index(:adverts, :category_id) | |
add_index(:adverts, :profile_id) | |
add_index(:adverts, :video_id) | |
add_index(:adverts, :active) | |
add_index(:advert_area_mappings, :advert_id) | |
add_index(:advert_area_mappings, :area_id) |
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
def check_if_rails_project | |
abort = 0 | |
unless File.exists?("Gemfile") | |
say "Missing Gemfile! Is this a rails project? If yes, something went really wrong, create your Gemfile and retry", :red | |
abort = 1 | |
end | |
unless File.exists?(Rails.root.join("config/routes.rb")) | |
say "Missing routes.rb! Is this a rails project? If yes, something went really wrong, create your routes.rb and retry", :red | |
abort = 1 | |
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 "gsadmin/engine" | |
require "rails" | |
module Gsadmin | |
class Engine < Rails::Engine | |
end | |
def self.config(&block) | |
yield Engine.config if block | |
Engine.config |
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
Gsadmin.config do |config| | |
config.route = "admin" | |
config.devise_model = "admin" | |
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
class Baby < RTanque::Bot::Brain | |
NAME = 'baby' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
test_sensors | |
if sensors.position.on_left_wall? | |
command.speed = 3 | |
command.heading = Math::PI | |
command.radar_heading = Math::PI |
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 Gsadmin | |
module Generators | |
class InitializerGenerator < Rails::Generators::Base | |
source_root File.expand_path("../templates", __FILE__) | |
desc "Gsadmin installation generator." | |
def welcome | |
say "Thank you for using gsadmin, if you have any questions, my email is [email protected]", :cyan | |
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
def describe_favorites(*games) | |
games.each do |game| | |
puts "Favorite Game: #{game}" | |
end | |
end | |
describe_favorites(['Mario', 'Contra', 'Metroid']) |