Skip to content

Instantly share code, notes, and snippets.

View ikhsanalatsary's full-sized avatar
🏠
Working from home

Abdul Fattah Ikhsan ikhsanalatsary

🏠
Working from home
View GitHub Profile
@ikhsanalatsary
ikhsanalatsary / git-log-json.sh
Created November 25, 2022 18:12 — forked from april/git-log-json.sh
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
@ikhsanalatsary
ikhsanalatsary / README.md
Created November 6, 2022 03:38 — 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

@ikhsanalatsary
ikhsanalatsary / push_to_github.rb
Created March 23, 2021 05:24 — forked from harlantwood/push_to_github.rb
Commit and push via Github REST API, from ruby RestClient
# Committing changes to a repo via the Github API is not entirely trivial.
# The five-step process is outlined here:
# http://developer.github.com/v3/git/
#
# Matt Swanson wrote a blog post translating the above steps into actual API calls:
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
#
# I was not able to find sample code for actually doing this in Ruby,
# either via the HTTP API or any of the gems that wrap the API.
# So in the hopes it will help others, here is a simple function to
import * as React from 'react'
import { Image, StatusBar, StyleSheet, useWindowDimensions } from 'react-native'
import {
PanGestureHandler,
PinchGestureHandler,
PinchGestureHandlerGestureEvent,
TapGestureHandler,
TapGestureHandlerGestureEvent,
} from 'react-native-gesture-handler'
import Animated, {
@ikhsanalatsary
ikhsanalatsary / log.js
Created January 27, 2021 01:32 — forked from vikas5914/log.js
Custom Logger Library with winston
const { createLogger, format, transports } = require('winston')
const moment = require('moment')
// set default log level.
const logLevel = 'info'
var logger = createLogger({
level: logLevel,
levels: {
fatal: 0,
@ikhsanalatsary
ikhsanalatsary / youtube-dl-pluralsight.md
Last active September 1, 2020 02:59 — forked from quangnd-pgvn/youtube-dl-pluralsight.md
Download Pluralsight videos

Download Plural Sight videos

Software required:

youtube-dl

After installation and putting the youtube-dl in PATH

youtube-dl --username YOUR_USERNAME --password YOUR_PASSWORD --all-subs https://app.pluralsight.com/library/courses/javascript-development-environment -o "~/video/%(playlist)s/%(chapter_number)s. %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s" --sleep-interval 10 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"
@ikhsanalatsary
ikhsanalatsary / clean-node-modules.sh
Created May 9, 2020 20:55 — forked from cusspvz/clean-node-modules.sh
Delete all node_modules folders RECURSIVELY
#!/bin/bash
# this will find all node_modules above your path and will remove them
find . | grep /node_modules$ | grep -v /node_modules/ | xargs rm -fRv
@ikhsanalatsary
ikhsanalatsary / add_python_to_WINDOWS_WSL_ubuntu.md
Last active June 6, 2021 13:23 — forked from monkut/add_python_to_WINDOWS_WSL_ubuntu.md
Add python to Windows Subsystem for Linux (WSL) [ubuntu]
@ikhsanalatsary
ikhsanalatsary / gist:819fd94c4cc32950831aa02472641dc4
Created September 1, 2018 03:08 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };