Skip to content

Instantly share code, notes, and snippets.

View al3rez's full-sized avatar

Alireza Bashiri al3rez

View GitHub Profile
{
// 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,
{
"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",
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 *
@al3rez
al3rez / linux-setup.sh
Created April 26, 2024 20:22 — forked from dhh/linux-setup.sh
linux-setup.sh
# 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
@al3rez
al3rez / clear-db.ts
Created April 20, 2024 19:24 — forked from rphlmr/clear-db.ts
Drizzle snippets
// 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';
`;
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'
;;; 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
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))
@al3rez
al3rez / 01_schema.sql
Last active January 29, 2020 09:13 — forked from vadv/01_schema.sql
/* 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 (
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