Skip to content

Instantly share code, notes, and snippets.

View habibrosyad's full-sized avatar
🚀

M. Habib Rosyad habibrosyad

🚀
View GitHub Profile
@habibrosyad
habibrosyad / README.md
Created October 19, 2023 03:32 — forked from palewire/README.md
How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.

Before you attempt the steps below, you need the following:

  • A GitHub repository that contains a working Dockerfile
  • The Google Cloud SDK tool gcloud installed and authenticated

Create a Workload Identity Federation

package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://shopee.co.id/api/v4/item/get?shopid=769712982&itemid=19519028347", nil)
@habibrosyad
habibrosyad / perf.dart
Created July 5, 2022 01:39
Chopper Firebase Performance Setup
class _FirebasePerformanceClient extends http.BaseClient {
_FirebasePerformanceClient(this._inner);
final http.Client _inner;
@override
Future<http.StreamedResponse> send(http.BaseRequest request) async {
final metric = perf.FirebasePerformance.instance
.newHttpMetric(request.url.toString(), mapMethod(request.method));
I/Timeline( 5901): Timeline: Activity_launch_request time:30724615 intent:Intent { cmp=com.gocuit.cuit.dev/com.banuba.sdk.ve.flow.VideoCreationActivity (has extras) }
W/ResourceType( 5901): No package identifier when getting name for resource number 0x00000000
W/ResourceType( 5901): No package identifier when getting name for resource number 0x00000000
W/art ( 5901): Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/FileCacheManager( 5901): Dir = /data/user/0/com.gocuit.cuit.dev/files/bg_sources does not have subdirectories nor files to delete
D/EffectPlayerResourceManager( 5901): Time to copy resources = 3
I/bnb_sdk ( 5901): [bnb_sdk|12:34:16|0x0000007fa0139aa0|INFO][resource_manager] construct
W/bnb_sd
I/Timeline(27575): Timeline: Activity_launch_request time:28892461 intent:Intent { cmp=com.gocuit.cuit.dev/com.banuba.sdk.ve.flow.VideoCreationActivity (has extras) }
W/ResourceType(27575): No package identifier when getting name for resource number 0x00000000
W/ResourceType(27575): No package identifier when getting name for resource number 0x00000000
W/art (27575): Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/FileCacheManager(27575): Dir = /data/user/0/com.gocuit.cuit.dev/files/bg_sources does not have subdirectories nor files to delete
W/EffectPlayerResourceManager(27575): shouldCopyResources
W/EffectPlayerResourceManager(27575): java.io.FileNotFoundException: /data/user/0/com.gocuit.cuit.dev/fil
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../components/app_bar_back_button.dart';
import '../../constants.dart';
import 'bloc/payment_cubit.dart';
@habibrosyad
habibrosyad / restore_error_crdb.log
Created August 25, 2021 02:22
restore_error_crdb
root@cockroachdb-public:26257/defaultdb> SELECT job_id, error FROM [SHOW JOBS] WHERE job_type = 'RESTORE';
job_id | error
---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------
687389045961916417 | failed to read backup descriptor: failed to get s3 object: RequestError: send request failed
| caused by: Get "https://nos.wjv-1.neo.id/kola-backup/coro-backup/BACKUP_MANIFEST": dial tcp: i/o timeout
687394747236384771 | importing 704 ranges: failed to get s3 object: RequestError: send request failed
| caused by: Get "https://nos.wjv-1.neo.id/kola-backup/coro-backup/687218406682624001.sst": dial tcp: lookup nos.wjv-1.neo.id on 10.96.0.10:53: no such host
687401113603047427 | importing 704 ranges: failed to get s3 object: RequestError: send request failed
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim-stack
spec:
storageClassName: volume-stack
accessModes:
- ReadWriteOnce
resources:
requests:
func (s *DBServiceImpl) ping() {
ticker := time.NewTicker(20 * time.Second)
// In case something happen with the connection, we can restart right away.
for range ticker.C {
func() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if err := s.db.PingContext(ctx); err != nil {
log.Fatal().Err(err).Msg("could not contact DB, terminating")
func GetAsset(ctx *gin.Context) {
group := ctx.Param("group")
params := strings.Trim(ctx.Param("params"), "/")
// Only check on post
if group == "post" || isUUID(group) {
var id string
if isUUID(group) {
id = group