Skip to content

Instantly share code, notes, and snippets.

View seagalputra's full-sized avatar

Dwiferdio Seagal Putra seagalputra

View GitHub Profile
@seagalputra
seagalputra / linked_list.py
Last active January 9, 2024 08:49
Python - Data Structures
import unittest
class Node():
def __init__(self, data):
self.data = data
self.next = None
def __str__(self):
return f"Node(data={self.data}, next={str(self.next)})"
@seagalputra
seagalputra / index.ts
Created June 2, 2023 13:06
WooCommerce API with Fetch
import OAuth from "oauth-1.0a";
import crypto from "crypto";
const authParams = {
consumer: {
key: "<consumer-key>",
secret: "<consumer-secret>",
},
signature_method: "HMAC-SHA256",
hash_function: (base: any, key: any) => {
from tkinter import *
from PIL import ImageTk
class Signup(Frame):
def __init__(self, parent, controller, sqliteConnection):
Frame.__init__(self, parent)
self.controller = controller
from tkinter import *
# car = ["Agya", "Calya", "Pajero"]
# {
# merk: "Agya",
# plat: "...",
# harga: "Rp 10.000"
# }
@seagalputra
seagalputra / gateway.js
Last active January 28, 2022 18:05
Sample Jest testing with modules
class Axios {
post() {
return true;
}
}
class Gateway {
constructor() {
this.api = new Axios();
}
@seagalputra
seagalputra / publisher.rb
Created January 14, 2022 11:08
Publisher abstraction for sending message using several message broker
class Publisher
attr_accessor :strategy
def initialize(strategy)
@strategy = strategy
end
def publish(data)
@strategy.call(data)
end
@seagalputra
seagalputra / generate_keys.md
Created August 5, 2020 04:15
Cheat sheet for generating public and private keys using keytool

Generating Keys with Keytool

$ keytool -genkey -alias <name> -keyalg RSA -keystore <filename.jks> -keysize 2048

Replace and with appropriate name without arrow brackets.

@seagalputra
seagalputra / grid.html
Created June 5, 2020 04:53
Simple solution to create unknown item grid using flexbox
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div>
@seagalputra
seagalputra / UserAccount.ts
Created March 21, 2020 13:46
Example of Builder Pattern using TypeScript
class UserAccount {
private firstName: string
private lastName: string
private username: string
private email: string
private password: string
constructor(
firstName: string,
lastName: string,

Manjaro Installation

Using the CLI

  1. Connect the USB flash drive to your PC, open a terminal and cd to where you downloaded the disc image.

  2. Check the device identifier with: sudo fdisk -l

  3. Write the image with: sudo dd if=manjaro-xfce-18.0-stable-x86_64.iso of=/dev/(Device identifier from above) bs=4M

    My USB drive is at /dev/sdc so I would use: sudo dd if=manjaro-xfce-18.0-stable-x86_64.iso of=/dev/sdc bs=4M