Skip to content

Instantly share code, notes, and snippets.

@gregjlee
gregjlee / agora_token_generator.rb
Created March 30, 2024 08:32
Agora Token Generator
#!/usr/bin/env ruby
require 'bundler/inline'
require 'securerandom'
require 'json'
require 'time'
require 'base64'
gemfile do
source 'https://rubygems.org'
@gregjlee
gregjlee / purge_cache.rb
Created September 26, 2023 20:52
clear stale repo github cache
#!/usr/bin/env ruby
require 'bundler/inline'
require 'json'
require 'time'
require 'date'
require 'active_support/core_ext/string/conversions'
gemfile do
source 'https://rubygems.org'
@gregjlee
gregjlee / update_subscription_feature_csv.py
Created August 2, 2023 21:10
Script to update a subscriptions csv with a new feature
import pandas as pd
import json
# reading the csv file
df = pd.read_csv("c.csv")
df.fillna('{}', inplace=True)
for i, r in df.iterrows():
json_object = json.loads(str(r['meta_data']))
feature = 'new_feature_to_add'
@gregjlee
gregjlee / osx_bootstrap.sh
Last active May 4, 2019 08:10
osx bootstrap
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
DELETE api/v1/part-inventory/:id
DELETE api/v1/assets/:id
DELETE api/v1/locations/:id
GET api/v1/part-inventory/
GET api/v1/assets/
GET api/v1/locations/
Example using Parts
/api/v1/part-inventory/?
Convert premium account status to AccountPlan:
"DEMO_MODE_ACTIVE" -> free
"STARTER_PLAN_ACTIVE" -> starter
"PROFESSIONAL_PLAN_ACTIVE" -> professional
"ENTERPRISE_ACTIVE" -> enterprise
"DEMO_EXPIRED_INACTIVE" -> free
"PLAN_EXPIRED_INACTIVE" -> free
Account plan order (I used an enum 0 - 3)
free < starter < professional < enterprise
@gregjlee
gregjlee / gist:5595916b0806ea39cb25f6d161a63b6e
Created April 3, 2017 20:31
Marketing Product Slider - Static + slider
"__comment": "ROW WITH 2 COLUMN",
"section": true,
"cols": [{
"type": "static",
"label": "Introducing Thrive Market products",
"sublabel": "Find your favorites for 25-50% less",
"link": "https:\/\/thrivemarket.com\/brand\/thrive-market",
"cta": "view more",
"button": false,
"action": "ca9e41",