Skip to content

Instantly share code, notes, and snippets.

View danggrianto's full-sized avatar
🎯
Focusing

daniel anggrianto danggrianto

🎯
Focusing
  • philadelphia, PA
View GitHub Profile
{
"id": "4a84a8e1-36cc-496c-a9b3-e079286c234f",
"name": "Foods",
"groups": [
{
"guid": "a6bf5591-85ea-4aae-a398-c38abadf2326",
"name": "Delicious Bites",
"description": "",
"items": [
{
@danggrianto
danggrianto / jedi-dvorak.json
Last active November 23, 2021 15:59
Iris v4 - custom keymap
{
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "keebio/iris/rev4",
"keymap": "dvorak",
"layout": "LAYOUT",
"layers": [
[
"KC_ESC",
@danggrianto
danggrianto / alias
Created May 15, 2020 17:52
aliases
# Shell
## Source .zshrc
alias sozsh="source ~/.zshrc"
## Edit aliases
alias aliases="vim ~/.aliases"
# Vim
alias vim='nvim'
@danggrianto
danggrianto / docker-compose.yml
Last active April 19, 2020 04:04
Installing Traefik on raspberry pi using docker + ansible https://blog.anggrianto.dev/installing-traefik-on-raspberry-pi/
version: '3'
services:
traefik:
image: traefik:v2.2
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
@danggrianto
danggrianto / hosts.yml
Created April 19, 2020 02:44
Install docker on raspberry pi
all:
children:
raspi:
ansible_host: <your-raspi-ip-address>
vars:
ansible_connection: ssh
ansible_user: pi
discovered_interpreter_python: /usr/bin/python3
{
"basics": {
"name": "Daniel Anggrianto",
"label": "Programmer, QA Automation Engineer",
"picture": "https://scontent.fewr1-5.fna.fbcdn.net/v/t1.0-9/p960x960/83454463_10157840898867488_425541756210118656_o.jpg?_nc_cat=107&_nc_ohc=XP5b5ZwKCsEAX_oUMlo&_nc_ht=scontent.fewr1-5.fna&_nc_tp=1002&oh=b16f524c9ac345d89673c70638e8af74&oe=5E995133",
"email": "daniel@anggrianto.com",
"phone": "(215) 869-5348",
"website": "http://anggrianto.com",
"summary": "A husband and a father.",
"location": {
@danggrianto
danggrianto / parallel_test.py
Created June 26, 2019 20:15
parallel testing demo
from unittest import TestCase
from uuid import uuid4
class ParallelTest(TestCase):
def setUp(self):
self._id = uuid4().hex
def test_uuid_one(self):
self.assertEqual('a', self._id)
@danggrianto
danggrianto / jenkins-shell.sh
Created April 22, 2019 15:54
Ignoring Jenkins Failures
# Run command but if there is error ignore it and save the status as error
command || error=true
if [ $error ]
then
exit -1
fi
@danggrianto
danggrianto / print_table.py
Created April 17, 2019 14:22
Print Table
def print_table(my_dict, col_list=None):
""" Pretty print a list of dictionaries (myDict) as a dynamically sized table.
If column names (colList) aren't specified, they will show in random order.
Author: Thierry Husson - Use it as you want but don't blame me.
"""
if not col_list:
col_list = list(my_dict[0].keys() if my_dict else [])
my_list = [col_list] # 1st row = header
for i in my_dict:
my_list.append([str(i[col] or '') for col in col_list])
@danggrianto
danggrianto / clean_code.md
Created April 15, 2019 14:22 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules