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
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
country=JP | |
network={ | |
ssid="<SSIDHERE>" | |
psk="<PASSWORDHERE>" | |
} |
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 | |
tests.test_enum || ', ' || (s.time_spent_working::float / (s.duration::float / 1000.0)) | |
from segments s | |
inner join calls c on c.id = s.call_id | |
inner join call_tests tests on tests.call_id = c.id | |
where c.status = 600 | |
and (s.time_spent_working::float / (s.duration::float / 1000.0)) < 30.0 -- remove potential outliers | |
and tests.test_uid = 'label_swap' | |
order by tests.test_enum |
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
# get data with | |
# curl -vX POST https://mandrillapp.com/api/1.0/messages/search.json -d @search.json --header "Content-Type: application/json" > test.json | |
# | |
# example search.json: | |
# | |
# { | |
# "key": "<CHECK CREDSTASH", | |
# "query": "coaching session with", | |
# "date_from": "2018-12-15", | |
# "date_to": "2019-02-18", |
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
company_map = Hash.new{|h,k| h[k] = { | |
count: 0, | |
viewed: 0, | |
replied: 0, | |
}} | |
comments = Comment | |
.joins("inner join users u on u.id = comments.user_id") | |
.joins("inner join mentions m on m.comment_id = comments.id") | |
.joins("inner join users mu on mu.id = m.user_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
old_form_id = # OLD FORM ID | |
new_form_id = # NEW FORM ID | |
old_form = FormTemplate.find(old_form_id) | |
new_form = FormTemplate.find(new_form_id) | |
old_form.form_template_items.each do |old_item| | |
attributes = old_item.attributes | |
attributes.delete("id") | |
attributes["form_template_id"] = new_form_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
old_form_id = # OLD FORM ID | |
new_form_id = # NEW FORM ID | |
old_form = FormTemplate.find(old_form_id) | |
new_form = FormTemplate.find(new_form_id) | |
old_form.form_template_items.each do |old_item| | |
attributes = old_item.attributes | |
attributes.delete("id") | |
attributes["form_template_id"] = new_form_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
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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
calls = Call.where(company_id: 62) | |
# RUN ONCE! | |
calls.each do |call| | |
call.occurred_at = call.occurred_at + 3.hour | |
mute_offsets = call.pp_data["mute_offsets"] | |
if !mute_offsets.nil? | |
new_offsets = [] | |
mute_offsets.each do |mute_offset| |
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/ruby | |
if ARGV.length < 2 | |
puts "USAGE: vo <table_key> <id/name>..." | |
exit 1 | |
end | |
def compile_cmd(table, arg, id) | |
psql_string = "psql -h platform-prod.czdz20rx7adk.us-west-2.rds.amazonaws.com -U clover -d ebdb -c" | |
where = id ? table[:id_where] : table[:string_where] |
NewerOlder