Skip to content

Instantly share code, notes, and snippets.

View t7y's full-sized avatar
🏠
Working from home

Jerry Tian t7y

🏠
Working from home
View GitHub Profile
@t7y
t7y / install-redis.sh
Last active December 26, 2015 14:19 — forked from dstroot/install-redis.sh
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/contentdj/7164925/raw/ca153f3ad5325ba6eb59ce2db7a5125d64569200/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@t7y
t7y / hotel_ratio.py
Last active March 31, 2020 02:04
hotel ratios sonder
from server.lib.arm.scheduled_rules.hotel_ratio_rules_manager import HotelRatioRulesManager
city_id = 9
bedroom_count = "2"
building_id = "1296"
HotelRatioRulesManager.apply_price_changes_for_segment(
city_id, building_id, bedroom_count
)
session = HotelRatioRulesManager.get_session()
[DEBUG] 2020-03-31 21:51:03,684 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9229 date:2020-05-26 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,684 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9235 date:2020-05-15 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,684 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9235 date:2020-06-14 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,684 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9240 date:2020-06-14 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,685 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9239 date:2020-06-09 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,685 - [server.lib.arm.scheduled_rules.hotel_ratio_rules_engine]: Skipping unit:9230 date:2020-05-19 attrs because its currently booked
[DEBUG] 2020-03-31 21:51:03,685 - [server.lib.