This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Editor appearance | |
"editor.fontFamily": "Inconsolata Nerd Font", | |
"editor.fontSize": 18, | |
"editor.lineHeight": 1, | |
"editor.lineNumbers": "off", | |
"editor.glyphMargin": false, | |
"editor.guides.indentation": false, | |
"editor.showFoldingControls": "never", | |
"editor.stickyScroll.enabled": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.fontFamily": "Pragmata Pro", | |
"editor.lineHeight": 1.2, | |
"terminal.integrated.fontSize": 14, | |
"editor.fontSize": 14, | |
"editor.glyphMargin": false, | |
"editor.folding": false, | |
"editor.stickyScroll.enabled": false, | |
"editor.guides.indentation": false, | |
"editor.scrollbar.horizontal": "hidden", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local wezterm = require("wezterm") | |
return { | |
font = wezterm.font_with_fallback({ | |
{ | |
family = "Monolisa Nerd Font", | |
weight = 500, | |
harfbuzz_features = { -- https://www.monolisa.dev/playground | |
"zero=1", -- slashed zero | |
"ss01=1", -- normal asterisk * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CLI | |
sudo apt update -y | |
sudo apt install -y \ | |
git curl docker.io \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ | |
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
libvips imagemagick libmagickwand-dev \ | |
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
rbenv apache2-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype plugin on " required | |
let maplocalleader="," | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} | |
Plugin 'janko/vim-test' | |
Plugin 'tpope/vim-rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; init.el --- Emacs init file | |
;; Author: Ian Y.E. Pan | |
;;; Commentary: | |
;;; A lightweight Emacs config containing only the essentials: shipped with a custom theme! | |
;;; Code: | |
(defvar file-name-handler-alist-original file-name-handler-alist) | |
(setq gc-cons-threshold most-positive-fixnum | |
gc-cons-percentage 0.6 | |
file-name-handler-alist nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Login | |
include ActiveModel::Model | |
attr_accessor :email, :password, :user | |
validates :email, presence: true | |
validates :password, presence: true | |
validates :user, presence: {message: "email or password is wrong"} | |
def initialize(params) | |
super(params.require(:user).permit(:email, :password)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* list of order */ | |
create table "order" ( | |
id text primary key, | |
created_at timestamp with time zone default current_timestamp, | |
processed_at timestamp with time zone, | |
processed_state text | |
); | |
/* processed transition on order.id */ | |
create table order_events ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_reader :first_name, :last_name | |
def initialize(first_name, last_name) | |
@first_name, @last_name = first_name, last_name | |
end | |
end | |
class PersonWithFullName < SimpleDelegator | |
def full_name |
NewerOlder