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
{ | |
"id": 2682, | |
"resolved_at": null, | |
"status": "dispatched", | |
"room_id": 100, | |
"call_type_id": 17, | |
"organization_id": 3, | |
"created_at": "2022-05-01T23:31:27.517Z", | |
"updated_at": "2022-05-01T23:49:04.140Z", | |
"updated_from": null, |
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
{ | |
"id": 100, | |
"name": "420", | |
"organization_id": 3, | |
"created_at": "2022-01-21T01:03:59.686Z", | |
"updated_at": "2022-01-21T01:11:48.494Z", | |
"connected_device": true, | |
"device": { | |
"id": 825, | |
"organization_id": 3, |
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
SELECT | |
SUM(joule_sale) as joule_sales, | |
SUM(premium_sale) as premium_sales, | |
date | |
FROM ( | |
SELECT | |
CASE WHEN amount > 15000 THEN 1 ELSE NULL END as joule_sale, | |
CASE WHEN amount < 15000 THEN 1 ELSE NULL END as premium_sale, | |
date_trunc('day', occurred_at - interval '8 hours') as date | |
FROM |
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
#!/usr/bin/env ruby | |
require 'stripe' | |
require 'byebug' | |
require 'json' | |
task :import_stripe_sales do | |
Stripe.api_key = ENV['STRIPE_SECRET_KEY'] | |
latest = @db.exec("SELECT details->>'id' as id FROM stripe_charges ORDER BY occurred_at DESC LIMIT 1").first | |
get_charges(latest['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
SELECT | |
title, | |
youtube_id | |
FROM | |
activities | |
WHERE | |
youtube_id = '/L7dvr5_At1Y' OR | |
youtube_id = '/wrALejpF-sY' OR | |
youtube_id = '/pheweKtzMNI' OR | |
youtube_id = '/uMQ8iJ4VIGk' OR |
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 'parse-ruby-client' | |
require 'date' | |
Parse.init application_id: ENV['PARSE_APP_ID'], | |
api_key: ENV['PARSE_API_KEY'], | |
master_key: ENV['PARSE_MASTER_KEY'], | |
quiet: true | |
def get_class(classname) | |
get_class_in_range(classname, Date.parse('2014-01-01'), Date.today + 1) |
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 results_for_report(report_token) | |
report = HTTParty.get('https://modeanalytics.com/api/Kitchenbowl/reports/'+report_token+'?embed%5Breport_runs%5D=1', @auth) | |
last_run_token = report['_embedded']['report_runs']['_embedded']['report_runs'][0]['token'] | |
results_url = HTTParty.get('https://modeanalytics.com/api/Kitchenbowl/reports/'+report_token+'/runs/'+last_run_token+'/results', @auth)['_links']['json']['href'] | |
JSON.parse(HTTParty.get(results_url)) | |
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
Our website is hosted on Heroku, which we deploy via git when we have new changes to make | |
It's SEO-preferable to have your sitemap.xml on the same domain/subdomain as the content being served. Might be SEO-impossible to do otherwise. | |
We want sitemap.xml to be decently up to date | |
We don't want sitemap.xml to be overwritten when we deploy a new version of the app | |
Solutions considered | |
1. (current) Kevin runs a script whenever he remembers that generates sitemap.xml, checks it in and pushes it | |
- Kevin is unreliable and his time is somewhat valuable.. sometimes |
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
#!/usr/bin/env ruby | |
# USAGE: ./scraper.rb emoji-cheat-sheet.com/public/index.html | pbcopy | |
# need to check out emoji-cheat-sheet from github | |
# ==> https://github.com/arvida/emoji-cheat-sheet.com | |
filename = ARGV[0] | |
file = File.new(filename, "r") |
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
#ui-datepicker-div | |
{ | |
.ui-datepicker-header | |
{ | |
background-image: none; | |
background-color: #0088cc; color: #fff; | |
.ui-datepicker-prev span.ui-icon | |
{ | |
background-image: url("/assets/glyphicons-halflings-white.png"); |
NewerOlder