Skip to content

Instantly share code, notes, and snippets.

View thanhtungka91's full-sized avatar
🎯
Focusing

Vo Thanh Tung thanhtungka91

🎯
Focusing
View GitHub Profile
@thanhtungka91
thanhtungka91 / main.go
Last active March 7, 2025 11:16
convert query to json for kibana
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
_ "os"
"regexp"
"fyne.io/fyne/v2"
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"regexp"
)
@thanhtungka91
thanhtungka91 / Shoryuken.rb
Created May 11, 2023 09:54
get all queue
# frozen_string_literal: true
require 'shoryuken'
require 'aws-sdk-sqs'
# `bundle exec rails runner "P20230511GenRemoveQueue::Patch.execute"`
class P20230511GenRemoveQueue::Patch
class << self
# frozen_string_literal: true
# `bundle exec rails runner "P20230510GenItemCustom::Patch.execute"`
class P20230510GenItemCustom::Patch
class << self
def execute
# gen CustomerCustomItem for Customer
Rails.logger.info("======== Start P20220518SetCustomReportConditionsUserIdsIfAllSelect #{Time.current} ==========")
Audits::AuditSession.set_skip_audit(1)
1. List all route
http://localhost:3000/rails/info/routes
explain the route
https://guides.rubyonrails.org/routing.html#path-and-url-helpers
@thanhtungka91
thanhtungka91 / errgroup_withcontext.go
Created June 8, 2022 02:43 — forked from dragonsinth/errgroup_withcontext.go
Using errgroup.WithContext() in Golang server handlers
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"sync/atomic"
"time"
/*
* Copyright 2020 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@thanhtungka91
thanhtungka91 / mainActitivy.java
Last active October 6, 2021 01:51
TWA start a new activity
protected CustomTabsSession getSession(CustomTabsClient client) {
return client.newSession((CustomTabsCallback) null, 96375);
}
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient client) {
CustomTabsSession mSession = MainActivity.this.getSession(client);
if (mSession == null) {
Toast.makeText(MainActivity.this,
"Couldn't get session from provider.", Toast.LENGTH_LONG).show();

get aliases to login

aws iam list-account-aliases

get users

aws iam list-users