- API / Data Server - Ruby on Rails using S3 and Heroku.
- iOS App - Objective-C / iOS
- Web Frontend - Ruby on Rails using S3 and Heroku.
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
if defined?(ActionDispatch); begin; ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML); rescue; end; end | |
if defined?(ActionController::Base) && ActionController::Base.respond_to?(:param_parsers); begin; ActionController::Base.param_parsers.delete(Mime::XML); rescue; end; end | |
if defined?(ActionDispatch); begin; ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::JSON); rescue; end; end | |
if defined?(ActionController::Base) && ActionController::Base.respond_to?(:param_parsers); begin; ActionController::Base.param_parsers.delete(Mime::JSON); rescue; 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
# Darcy's public key | |
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAlhcBKPcWKMOVHreqrlSCO5JIKGsmOL30+y/OmqlsbNOHrs0/JpiLpVGowPgAfP02pIjp/GlMFjtfvkgsidXTbkqywZmh45Axh0D5ZmO305N42xTekZ3VJR2x6fn6uZySXrd7GOZIDuQcTsEqsl4wrae1DT66a769RNwYbIRKarBTxlA8C2Zb8I9qvizLg6OV45/Q7vH0TMtQ+3Rfs6GlGJzrbeqH4S8mNzPH9Z9cz2vB+6y0NFBcROT/5xIjFVr0yaKjJiyGOOh/IQZ7aO2pwl/Ozr3vweJ6wTnDCgJ5+5AGLCmzi75JR0f4bEcR+Gt5f4hnOFrOZpM+ppG4Sx4WvQ== |
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
UILocalNotification *localNotification = [UILocalNotification new]; | |
NSDate *dateToFire = [[NSDate date] dateByAddingTimeInterval:2]; | |
localNotification.fireDate = dateToFire; | |
localNotification.alertBody = @"Time to update your profile"; | |
localNotification.soundName = UILocalNotificationDefaultSoundName; | |
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; |
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
# First: Product - Default without setting hash defaults: | |
x = %w(a b c) | |
h = Hash[x.product([true])] | |
p h # => {'a' => true, 'b' => true, 'c' => true} | |
p h['a'] # => true | |
p h['d'] # => nil | |
# e.g: sphinx takes a hash of field name -> weight pairs, so we use | |
def search_weights |
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 'rubygems' | |
# Set up gems listed in the Gemfile. | |
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | |
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) | |
# Uses forman to boostrap ENV from a .env environment. | |
# This is mostly useful since it means we can then use it from | |
# things other than foreman (passenger, our own scripts) with easy. |
First, there is an incredible breadth of free and paid online coursework you can use to keep going on. The following list are ones we recommend (as does Rails Girls internationally) that cover most topics you need to actually make something:
- Codecademy is a great series of interactive tutorials designed to teach you the basics of programming.
- Try Ruby as you've seen is an introduction to the Ruby language - it assumes some general programming concepts, but it's important to understand Ruby and not just Rails (which sits on top of it).
- Code.org is an incredible program designed to encourage Computer Science among high school students. I highly suggest checking out their video and their learning page - which links to many online resources that have free programming tutorials.
- Coursera and Udacity are two online university-style teaching places, wit
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 ApiController < RocketPants::Base | |
# Override the json encoding mechanism to use Oj for mega-speed! | |
def encode_to_json(json) | |
Oj.dump json, mode: :compat | |
end | |
add_method_tracer :encode_to_json | |
end |
We use this flow with AWS lambda, combined with CloudWatch Scheduled Events, to trigger our builds periodically.
It's nice, avoids duplication and keeps everything together easily.
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
from urllib.request import Request, urlopen | |
import ssl | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
url = 'https://www.who.int/emergencies/diseases/novel-coronavirus-2019/media-resources/news' | |
################################################# | |
################################################# |