Skip to content

Instantly share code, notes, and snippets.

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

Abdurrahman Shofy Adianto azophy

🏠
Working from home
View GitHub Profile
@azophy
azophy / css-flex-grid-quickstart-example.html
Created June 8, 2021 14:29
flexbox & grid layout quickstart example for webpage layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Quick CSS Flexbox & Grid Example</title>
</head>
<body>
<h2>Grid example</h2>
<p>
Grid allows better layout oriented design vs content oriented design of flex's. ref: https://torquemag.io/2020/04/css-grid-tutorial/
@azophy
azophy / urllib-http-post.py
Created May 30, 2021 17:03
Python: send HTTP POST with built-in library (urllib)
#!/env/python
# send HTTP POST with empty body
# taken from https://stackoverflow.com/a/64860348/2496217
from urllib import request
req = request.Request(
'https://postman-echo.com/post',
method='POST',
@azophy
azophy / howto-gitlab-runner-other-user.sh
Created May 29, 2021 20:53
How to set gitlab runner to execute command as other user beside 'gitlab-runner'
#!/bin/sh
# reference: https://stackoverflow.com/a/62722622/2496217
# stop & uninstall gitlab runner service
sudo gitlab-runner uninstall
# re-install as other use
sudo gitlab-runner install \
--user azophy \
--working-directory /home/azophy/deploy \
@azophy
azophy / github_stat_compare.html
Created January 12, 2021 07:26
Compare statistics for Github Repos
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Analyze Github Stats</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>
<style>
table {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;

Keybase proof

I hereby claim:

  • I am azophy on github.
  • I am azophy (https://keybase.io/azophy) on keybase.
  • I have a public key ASCfauksy4CWY9hrmlc4q5Yj3eHmq9Z0Kn1I0s96948aDwo

To claim this, I am signing this object:

@azophy
azophy / make.py
Created January 23, 2019 10:09
Python based Sphinx make file. Good for uniform make method across platforms
#!/usr/bin/env python
"""
Python script to run the build process on all environtment. Intended to be
replacement to Makefile and make.bat
idea : https://github.com/sphinx-doc/sphinx/issues/3196
Run:
@azophy
azophy / ULTRA SHORT VIM QUICKREF.md
Created July 29, 2017 03:51
ULTRA SHORT VIM QUICKREF

vim nama_file.txt

  • enter "command mode" -> esc button
  • enter "insert mode" -> i
  • save current file -> :w
  • exit vim -> :q
@azophy
azophy / upload.sh
Created July 7, 2017 04:27
Simple GitLab Bash automated upload script
#!/bin/bash
# SIMPLE GITLAB UPLOAD AUTOMATION SCRIPT
# AUTHOR : Abdurrahman Shofy Adianto [ azophy.github.io ]
# usage:
# - dont forget to make this script executable by running "chmod +x upload.sh"
# - the only argument is aditional branch to be included after merging develop, for example: master
lokasi=$(git branch | grep \* | cut -d ' ' -f2)
develop_branch='develop'
@azophy
azophy / mysql_create_commands.md
Last active July 7, 2017 03:00
MySQL create new Database template commands

First, terminal commandsudo mysql -uroot -p then on mysql console:

create database monicadb;
CREATE USER 'monica'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL ON monicadb.* TO 'monica'@'localhost';
FLUSH PRIVILEGES;
exit
@azophy
azophy / pyside_custom_progress_bar.py
Last active May 15, 2017 07:10
Example of modifying PySide's QProgressBar format to show progress percentage to 2 decimals
from PySide.QtGui import *
from PySide.QtCore import *
"""
Custom ProgressBar with percentage displayed with 2 decimals after point
ref: http://stackoverflow.com/a/11694473/2496217
"""
class CustomProgressBar(QProgressBar):
def __init__(self,parent=None):
super(CustomProgressBar, self).__init__(parent)