This file contains hidden or 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
import requests | |
def visit(d): | |
print "Visit: %s" % d.url | |
if 'follow' in d.json(): | |
visit(requests.get(next_link(d))) | |
else: | |
print d.text | |
def next_link(d): |
This file contains hidden or 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
<!DOCTYPE html SYSTEM> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<title>Brokermint</title> | |
<style type="text/css"> | |
.fa { | |
display: inline-block; | |
font: normal normal normal 14px/1 FontAwesome; |
This file contains hidden or 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
## sCala | |
7-8.5mil/mo. Awesome pool. Very Posh. Breakfast incl. Neighborhood ok, halfway between Kuta and Canggu. | |
`0.3 down / 0.3 up`. | |
## Aqua blue | |
4.5/mo. Pool. 2nd floor. Kitchen in room w/ dishes. Desk and table. Neighborhood ok, (next to cScala). | |
`0.3 down / 1 up`. | |
## filadelphina bali guest house / kemiri home stay | |
aka Kemiri home stay (brother/sister joint business). 4.5 mil / mo. Basic. Desk. Bed. Aircon. Fridge kitchen share with owner. Pretty. Across from satu satu. Quiet road (raya pantai baway). |
This file contains hidden or 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
#!/usr/bin/env ruby | |
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) | |
require 'heroku' | |
require 'heroku/command/fork' | |
require 'heroku/command/run' | |
require 'github_api' | |
require 'heroku/client/pgbackups' |
This file contains hidden or 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
git branch -a | grep /origin/ | awk -F/ '{print $3}'| xargs -I {} git push origin :{} |
This file contains hidden or 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 Logger::SimpleFormatter | |
def call(severity, time, progname, msg) | |
if Rails.env.production? && (severity == "FATAL" || severity == "ERROR") | |
@context = { :severity => severity.to_s, :time => time.to_s, :msg => msg.to_s } | |
Honeybadger.context(@context) | |
Honeybadger.notify(@context) | |
end | |
return "[#{severity}] #{msg}\n" | |
end |
This file contains hidden or 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
# read here: http://blog.iempire.ru/2015/10/13/profiling-specs/ | |
RSpec.configure do |config| | |
config.around(:each) do |example| | |
path = Rails.root.join("tmp/stackprof-cpu-test-#{example.full_description.parameterize}.dump") | |
StackProf.run(mode: :cpu, out: path.to_s) do | |
example.run | |
end | |
end | |
end |
This file contains hidden or 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 QuestionType | |
## This is a class to avoid database lookup for survey_question_types table | |
## replicate actual table : | |
# id => :name | |
DATA = { | |
3 => 'Rank order', | |
4 => 'Constant sum', | |
5 => 'Drop-down menu', | |
6 => 'Numeric Freeform Input', | |
7 => 'Comment Box', |
This file contains hidden or 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 'ostruct' | |
require 'benchmark' | |
require 'values' | |
COUNT = 10_000_000 | |
NAME = "Test Name" | |
EMAIL = "[email protected]" | |
class Person | |
attr_accessor :name, :email |
This file contains hidden or 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
source 'https://rubygems.org' | |
ruby '2.4' | |
gem 'benchmark-ips' |