Skip to content

Instantly share code, notes, and snippets.

View andhikayuana's full-sized avatar
🌏
bertapa

Andhika Yuana andhikayuana

🌏
bertapa
View GitHub Profile
@andhikayuana
andhikayuana / multiple_ssh_setting.md
Created February 27, 2020 03:52 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@andhikayuana
andhikayuana / laravel-queue.service
Created February 20, 2020 15:19 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@andhikayuana
andhikayuana / postgres_queries_and_commands.sql
Created January 10, 2020 12:43 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@andhikayuana
andhikayuana / deploy-create-react-app-with-nginx.md
Created October 21, 2019 14:02 — forked from huangzhuolin/deploy-create-react-app-with-nginx.md
[Deploy create-react-app(react-router) with nginx] #react #nginx

Create-react-app

Create React apps with no build configuration.

Thanks to create-react-app. It's saves a lot of my time. I remember several months ago I had to setup a lot just for a react app, webpack, babel, test environment and so on... Fortunately, everything becomes easy now. Though you have many choices of start boiler plate, you worth trying this.

React router

If you are build a SPA with react, you probably use react-router.

@andhikayuana
andhikayuana / postgresql-set-id-seq.sql
Created October 3, 2019 17:11 — forked from henriquemenezes/postgresql-set-id-seq.sql
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@andhikayuana
andhikayuana / README-Template.md
Created October 2, 2019 09:00 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@andhikayuana
andhikayuana / podforceupdate.sh
Created September 22, 2019 01:09 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@andhikayuana
andhikayuana / wa_rotator.html
Created September 8, 2019 14:34 — forked from adxio/wa_rotator.html
Simple rotator wa,
<html>
<div id="product_name">Kacamata</div>
<div id="product_group">Fashion</div>
<div id="product_id">10</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script language="JavaScript">
var product_id = $('#product_id').text()
var product_name = $('#product_name').text()
var product_group = $('#product_group').text()
var phone = ['6281312020954','6281312020941','6281312020938']
@andhikayuana
andhikayuana / 01.md
Created July 2, 2019 17:12 — forked from nasrulhazim/01.md
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users
@andhikayuana
andhikayuana / Tetris.java
Created June 21, 2019 03:02 — forked from DataWraith/COPYING
A simple Tetris clone written in Java
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.JFrame;
import javax.swing.JPanel;