Skip to content

Instantly share code, notes, and snippets.

View iamajvillalobos's full-sized avatar

AJ Villalobos iamajvillalobos

View GitHub Profile
@iamajvillalobos
iamajvillalobos / sidekiq-useful-commands.md
Created September 26, 2017 02:12
Useful Sidekiq commands you should know

Clear scheduled stats

Sidekiq::ScheduledSet.new.clear

Clear retry stats

Sidekiq::RetrySet.new.clear

Clear all stats

Sidekiq::Stats.new.reset

@iamajvillalobos
iamajvillalobos / gist:8189d293155de032e3afab772a9163ed
Created September 21, 2017 05:57
Change sublime editor to be the default git editor
git config --global core.editor "subl -n -w"
make a post about how to update fork repos
https://help.github.com/articles/configuring-a-remote-for-a-fork/
https://help.github.com/articles/syncing-a-fork/
@iamajvillalobos
iamajvillalobos / gist:4388a1327e4cf15748e4d3fb8228e446
Created September 19, 2017 00:29
install pg gem with postgres app on mac os
gem install pg -v '0.21.0' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
{
"hook_id" => 4665,
"hook_key" => "bdb0fcad-7e34-46c4-98a4-1a98ce88098a",
"hook_time" => 1505180789,
"hook_signature" => "X-Webhook-Signature",
"payload" => {
"organisation_id" => 48944,
"data" => {
"business_name" => "MKT",
"staff" => "10",
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"time_zone": "US/Pacific",
"total_count": 0
},
"objects": []
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"time_zone": "US/Pacific",
"total_count": 3
},
"objects": [
@iamajvillalobos
iamajvillalobos / response_no_person_id.json
Last active August 18, 2017 01:19
webhook response without person id
{
"v" => 1, "matches_filters" => {
"current" => []
}, "meta" => {
"v" => 1,
"action" => "added",
"object" => "deal",
"id" => 25933,
"company_id" => 1385452,
"user_id" => 2183736,
# How to group this collection so that Clover::Order will be grouped by every 15 mins
{
Sun, 09 Jul 2017 => [
#<Clover::Order:0x007f82efc7a758
@created_time=2017-07-10 00:15:00 +0800,
@id="5CY4WQG1XWJK1",
@state="paid",
@total=1234>,
#<Clover::Order:0x007f82efc6b550
url = "/merchants/#{merchant_id}/orders"
if state && start_datetime && end_datetime
url += "?filter=createdTime>=#{start_datetime}"
url += "&filter=createdTime<=#{end_datetime}"
url += "&filter=state=#{state}"
elsif start_datetime && end_datetime
url += "?filter=createdTime>=#{start_datetime}"
url += "&filter=createdTime<=#{end_datetime}"
elsif state