Skip to content

Instantly share code, notes, and snippets.

View arvindkgs's full-sized avatar

Arvind Kumar GS arvindkgs

View GitHub Profile
@arvindkgs
arvindkgs / README.md
Created February 21, 2022 14:50
Stripe Subscription with Billing cycle anchor does not apply discounts on initial invoice

I am creating a subscription with billing_cycle_anchor set to first day of next month. Below is the params passed when creating subscription

{
  "metadata": {
    "tenant_id": "2cf19732-0c7b-42e4-a0a2-90fd9c0e7111"
  },
  "collection_method": "send_invoice",
  "days_until_due": "30",
  "backdate_start_date": "1645171200",
 "items": {
@arvindkgs
arvindkgs / Tempo.md
Created October 29, 2021 15:40
[Tracing]

to print trace id in logs "--distributor.log-received-traces=true"

@arvindkgs
arvindkgs / Docker Compose.md
Last active October 24, 2021 06:37
[docker] #docker #local-setup #dev-env

Start

docker compose up

start options

Run in background, -d : docker compose up -d

Stop

docker compose down

options

Remove all images and rebuild docker compose down --volumes --remove-orphans --rmi all

@arvindkgs
arvindkgs / README.md
Last active September 5, 2021 12:57
zshrc
  1. Quickly jump to bookmark'd folders: goto @project
    Setup:
    1. create directory ~/.bookmarks
    2. Add below to .zshrc
    if [ -d "$HOME/.bookmarks" ]; then
        export CDPATH=".:$HOME/.bookmarks:/"
        alias goto="cd -P"
    fi
    
@arvindkgs
arvindkgs / iterm2.md
Last active August 24, 2021 06:51 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Open Tab in specific profile + o
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
@arvindkgs
arvindkgs / Disable.md
Created July 31, 2021 11:44
[spring-security] Spring security
@Configuration
public class ApplicationSecurity extends WebSecurityConfigurerAdapter {

    @Override
    public void configure(WebSecurity web) throws Exception {
        web
           .ignoring()
               .antMatchers("/**");
 }
@arvindkgs
arvindkgs / H2.md
Last active October 8, 2021 14:01
[Java Date Time] DateTime Handling

When saving dates in UTC, H2 will not save in UTC. To force setting all datetimes in UTC timezone in Junit add below to test case

@BeforeClass public static void setTimezone() { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); }

@arvindkgs
arvindkgs / README.md
Last active April 10, 2024 10:40
[Mac] MacOS tools and applications #devtools

My setup and customization on MacOS, to make me more productive

Below are applications I install first thing on a new Mac. They have become a part of all my Macs and they are the first things I install on a new Mac
  1. Chrome - Personal browsing
  2. Arc - Corporate browsing
  3. Google Drive - My personal documents sync
  4. pCloud - Misc sync
  5. Copy ssh keys into .ssh folder and test using https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection
  6. (If using dotfiles) Backup .zshrc other files and migrate dotfiles - https://www.atlassian.com/git/tutorials/dotfiles
  7. Homebrew - package manager
@arvindkgs
arvindkgs / Talk.md
Last active April 25, 2021 05:28
[Contract-first-development] Tech talk on Swagger Code generation
  1. Create directory - mkcdir barcampbangalore
  2. Open swagger editor - https://editor.swagger.io/
  3. Create Bookstore API Get Books
    • Author and/or Name Add Books Get Authors
    • Book name
openapi: 3.0.2
---
openapi: 3.0.2
info:
title: billing
version: 1.0.0
description: Billing Service APIs
servers:
- url: http://localhost:8080/v1
description: Localhost
paths: