Skip to content

Instantly share code, notes, and snippets.

View austindoeswork's full-sized avatar
🐣
hatchin' a plan

austin austindoeswork

🐣
hatchin' a plan
  • San Francisco
View GitHub Profile
@austindoeswork
austindoeswork / wpa_supplicant.conf
Created January 14, 2021 06:21
wpa_supplicant for raspi
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP
network={
ssid="<SSIDHERE>"
psk="<PASSWORDHERE>"
}
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
# 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",
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")
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
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
# 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).
# 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).
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|
#!/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]