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 'csv' | |
require 'active_support' | |
require 'active_support/core_ext' | |
def command(json, id) | |
"curl -v -s -X PATCH " \ | |
"-H 'Authorization: Bearer #{ENV['BUBBLE_API_KEY']}' " \ | |
"-H 'Content-Type: application/json' " \ | |
"-d '#{json}' " \ | |
"'https://#{ENV['BUBBLE_API_HOST']}/api/1.1/obj/project/#{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
#!/usr/bin/env ruby | |
# a dump of the funnel_exec table from big query is needed in line-separated-json format | |
# also we need a csv file with information about lead creation, email and pipedrive ids | |
# | |
# three positional parameters must be passed: | |
# * input json path | |
# * input csv path |
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 | |
PROJECT_ID_KEY = 'respectiveproject_custom_project'.freeze | |
USER_ID_KEY = 'sender_user'.freeze | |
MESSAGETYPE_MATCHER = lambda { |k, entry| entry['messagetype_text'] == 'RequestProjectData' } | |
# message downloader extending from | |
module Imports | |
module BubbleApi | |
class Message < Record |
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
# | |
# steps to migrate investors to user accounts: | |
# | |
# 1. generate users in correct state (can be declined if only declined profiles exist) | |
# 2. re-synchronize with bubble if necessary | |
# 3. send emails for password reset | |
# | |
# User generation |
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 'csv' | |
require 'yaml' | |
require 'active_support/core_ext/string' | |
PUBLIC_ROLE = 'Public' | |
ROLES = ['Admin', 'Carl Employee', 'Investor', 'Advisor'].freeze |
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
#!/bin/bash | |
# parse options | |
# a => Auth string formatted <user>:<pass> | |
# f => file location (hyperlink etc…) | |
# t => kodi/xbmc target in <ip>:<port> | |
while getopts 'a:f:t:' OPT; do | |
case $OPT in | |
a) AUTH=$OPTARG;; | |
f) URL=$OPTARG;; |
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
--- | |
- de: Baden-Württemberg | |
en: Baden-Württemberg | |
- de: Bayern | |
en: Bayern | |
- de: Berlin | |
en: Berlin | |
- de: Brandenburg | |
en: Brandenburg | |
- de: Bremen |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
Nigeria;Nigeria | |
Gambia;Gambia | |
Argentinien;Argentina | |
Hongkong;Hong Kong | |
Turks- und Caicosinseln;Turks and Caicos Islands | |
Guernsey;Guernsey | |
Malediven;Maldives | |
Syrische Arabische Republik;Syrian Arab Republic | |
Vereinigte Arabische Emirate;United Arab Emirates | |
Tansania;Tanzania |
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 | |
BuyingProfile.new | |
Address.new | |
data = YAML.load_file('imports.yml') | |
import = Import.create!(source: 'CUSTOM/CR/201902', import_start_at: Time.current) | |
data[:addresses].each do |a| |
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 | |
ActiveRecord::Base.logger = nil | |
where_after_date = begin | |
Time.iso8601(ARGV[0]) | |
rescue | |
Date.new(2018,10,30).end_of_day | |
end |