Skip to content

Instantly share code, notes, and snippets.

View johnhamelink's full-sized avatar
🔨
Building

John Hamelink johnhamelink

🔨
Building
View GitHub Profile
Feature: Connecting users by extra information
Scenario: Connect user by alternative phone number
Given Current User has <num_devices> devices
Given Current User has registered with only one device
When Other User has a ContactBookItem for Current User
When ContactBookItem has all Current User's devices
Then ContactBookItem's 'contact_session_id' will equal Current Users's ID
Examples:
class ContactDetail < ActiveRecord::Base
belongs_to :session
before_save :normalize_phone_number
after_commit :check_for_connections
def self.find_by_phone_number(phone_number)
ContactDetail.find_by(key: 'phone_number', value: phone_number)
end
def self.find_phone_number_by_session(session)
class ContactImportJob < ActiveJob::Base
queue_as :default
include Concerns::Logging
include Concerns::Errors
# For each contact, import them and link them
# up to the user. After, send a push notification
# to notify the app that the contacts have synced
# successfully. If there is an error, end
# pre-emptively and send a standard push
export AWS_DEFAULT_REGION='eu-west-1'
clockwork_exists="$(aws ec2 describe-tags --filter "Name=key,Values=Processes" | jq '.Tags[].Value' | grep clockwork)"
if [ "$clockwork_exists" ]
then
echo "YEP"
else
echo "NOPE"
fi
#!/usr/bin/env bash
ssh-add ~/.ssh/findaplayer.pem
remote_user="ec2-user"
hop_user="ubuntu"
hop_host="hop"
if [ "$1" == "ssh" ]; then
ssh -A -t -l $hop_user $hop_host \
ssh -A -t -l $remote_user $2
#!/usr/bin/env bash
ssh-add ~/.ssh/findaplayer.pem
if [ "$1" == "ssh" ]; then
ssh -A -t -l ubuntu hop \
ssh -A -t -l ubuntu $2
exit 0
fi
if [ "$1" == "tunnel" ]; then
Host hop
Hostname hop.findaplayer.com
User ubuntu
IdentityFile ~/.ssh/findaplayer.pem
ForwardAgent yes
async_job: {
message: message,
job_name: job.name.underscore,
status: status
}
{:xmlel, "message", [{"to", "johnhamelink@chat.livecoding.tv"}, {"type", "groupchat"}, {"id", "3584"}, {"xml:lang", "en"}], [{:xmlel, "body", [], [xmlcdata: "Lorem Ipsum"]}]
{
"accounts": [
{
"name": "FarmGeek",
"client_id": "112151301201929040317",
"client_email": "account-1@gcontacts-to-phone-elixir.iam.gserviceaccount.com",
"rsa_key_path": "config/service_account_secrets/google_service_account.key.pem",
"account_emails: ["john@johnhamelink.com"]
}
]