Skip to content

Instantly share code, notes, and snippets.

@philiplambok
philiplambok / Gemfile
Created December 17, 2023 12:07
Rack Mini Profiler
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
gem "rack-mini-profiler"
gem "memory_profiler"
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
{
"transaction_attachment": {
"id": 118630,
"transaction_id": 2849716,
"file": {
"url": "https://jurnal-quickbook-dev.jurnal.id/uploads/transaction_attachment/file/118630/Screen_Shot_2023-09-21_at_10.30.04.png"
},
"created_at": "2023-09-21T08:59:46.434Z",
"updated_at": "2023-09-21T08:59:46.434Z",
"transaction_token": "RbnVvP8gd-92Ud532jp0zg",

Name: [Your Name] Contact Information:

  • Phone number: [Your phone number]
  • Email address: [Your email address]
  • LinkedIn: [Your LinkedIn profile URL, if applicable]

Summary: Experienced secondary school teacher with a passion for creating an inclusive and engaging learning environment for all students. Adept at using technology to enhance the curriculum and tailoring instruction to meet the unique needs of each student. Strong ability to communicate with students, parents, and colleagues, and to build positive relationships with all stakeholders.

Education:

{
"editor.fontFamily": "Comic Mono, Roboto Mono, Jetbrains Mono, IBM Plex Mono, Dank Mono, Menlo, Monaco, 'Courier New', monospace",
"workbench.editor.showTabs": false,
"workbench.statusBar.visible": false,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
// For Stylelint
// "stylelint.autoFixOnSave": false,
"workbench.colorCustomizations": {
"terminal.ansiBrightCyan": "#EE64AE",
@philiplambok
philiplambok / specs.yaml
Created October 23, 2022 15:44
Learn Open API 3.0
openapi: 3.0.0
info:
version: 1.0.0
title: P & T Kitchen
description: The payment gateway that you don't hate.
servers:
- url: https://api.kitchen.com/api/v1
- url: https://staging-api.kitchen.com/api/v1
@philiplambok
philiplambok / go-methods.go
Created September 18, 2022 07:29
go methods
package main
import "fmt"
type Person struct {
FirstName string
LastName string
}
func (p Person) fullName() string {
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
words := strings.Split(s, " ")
var count int
@philiplambok
philiplambok / compound-interest.rb
Last active September 7, 2022 02:16
compound-interest Neo Bank VS SSF
# only runnable inside Rails web application
include ActionView::Helpers::NumberHelper
def to_idr(amount)
number_to_currency(amount, unit: 'Rp.', precision: 3)
end
def noebank
net_worth = 0
emergency_fund = 30_000_000
{
"editor.fontFamily": "Comic Mono, IBM Plex Mono, Jetbrains Mono, Dank Mono, Menlo, Monaco, 'Courier New', monospace",
"workbench.iconTheme": "vscode-icons",
"workbench.editor.showTabs": false,
"workbench.statusBar.visible": false,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
// "plantuml.server": "https://www.plantuml.com",
// "plantuml.render": "PlantUMLServer",
// "ruby.useLanguageServer": true,
transactions_group_by_proforma = Transaction.select('transaction_id as id, count(proforma_id) as proforma_count').group('transaction_id')
transactions = Transaction.where(transaction_id: transactions_group_by_proforma.map(&:id)).where.not(proforma_id: nil).group_by(&:transaction_id)

transactions_group_by_proforma.each do |parent_transaction|
  puts "Root: #{parent_transaction.id}, Proforma: #{parent_transaction.proforma_count}"
  puts "--- Childs ---"
  if transactions[parent_transaction.id.to_i].present?
    transactions[parent_transaction.id.to_i].each.with_index(1) do |child_transaction, index|
      puts "#{index}: #{child_transaction.proforma_no}"