##Field Journel Docs
We will document all software development by following this pattern.
git clone https://github.com/Paradigmisr/field_journel_docs.git
When creating new files follow this pattern
Routing: append Routing.md
require 'yaml' | |
require 'colorize' | |
file = Dir.pwd + "/themes.yml" | |
puts "1. Rate theme" | |
puts "=-=-=-=-=-=--=-=-=-=-=-=" | |
puts "2. List all rated themes" | |
puts "=-=-=-=-=-=-=-=-=-=-=-=-" | |
input = gets.chomp |
$ -> | |
#this effect takes 4 arguments | |
#the first is the 'div' that is intended to be faded | |
#the second 'tall' is the integer to be multiplied by the divs height | |
#like for the second div you would multiply by 2 | |
#the third arg 'adjustment' is to start the fade before the | |
#div is out of sight | |
#the fourth is a lambda option with default null | |
#this arg must be a funtion in this case i want the globe to |
require "colorize" | |
module Adjuster | |
def self.method_time | |
Adjuster.measure {BetterBenchmark.new} | |
end | |
def self.block_time | |
x = measure {yield} |
require 'net/https' | |
require 'uri' | |
require 'json' | |
API_KEY = '59a3d0192d16da2a2d739d0c9d25fdf4' | |
CITY = 'seattle' | |
uri = URI.parse("https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=#{API_KEY}&tags=#{CITY}&safe_search=1&per_page=10&page=1&format=json&nojsoncallback=1") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true |
require "minitest/autorun" | |
class Archeology | |
#The method 'function' takes a single argument. The argument must be a collection, | |
#or at least something enumerble since the inject method is used. Inject's | |
#argument is an accumulator the block proceding has two interpolations. The | |
#first is injects accumulator, an empty hash. The second "val" will iterate thru | |
#the collection given to the function method. The block of code that follows | |
#does something really funny. It begins to populate the empty hash or |
require "minitest/autorun" | |
class Archeology | |
#The method 'function' takes a single argument. The argument must be a collection, | |
#or at least something enumerble since the inject method is used. Inject's | |
#argument is an accumulator the block proceding has two interpolations. The | |
#first is injects accumulator, an empty hash. The second "val" will iterate thru | |
#the collection given to the function method. The block of code that follows |
# this request will show you a headcount of 10 | |
https://api.meetup.com/2/event/5898549\?sign\=true\&key\=59512b1f5939553e4e7962a15154c | |
# this request will show you the attendance *NOTICE* the members id's are | |
# missing | |
https://api.meetup.com/momsmeetupofco/events/5898549/attendance%5C?sign%5C=true%5C&key%5C=59512b1f5939553e4e7962a15154c | |
# Same attendance request with filter=all | |
http https://api.meetup.com/momsmeetupofco/events/5898549/attendance\?sign\=true\&key\=59512b1f5939553e4e7962a15154c\&filter\=all |
# The original method | |
def create_report_identifier | |
field = Field.find(self.field_id) | |
field_name = field.field_name | |
report_date = self.date.to_s | |
self.report_identifier_id = field_name << ' ' << report_date | |
end | |
# the decoupled version | |
# law of demeter |
##Field Journel Docs
We will document all software development by following this pattern.
git clone https://github.com/Paradigmisr/field_journel_docs.git
When creating new files follow this pattern
Routing: append Routing.md
require 'test_helper' | |
class ScoutTest < ActiveSupport::TestCase | |
test | |
end |