Skip to content

Instantly share code, notes, and snippets.

View al3rez's full-sized avatar

Alireza Bashiri al3rez

View GitHub Profile
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
# frozen_string_literal: true
class ChangePackage
include Failable
attr_reader :subscription, :package, :expire_date, :package_history
private *delegate :store_campagin!, :upcoming_package_change?
:current_invoice, to: :subscription
def initialize(subscription, package)
module Failable
class Result < SimpleDelegator
def initialize(success, object = nil)
@success = success
super(object)
end
def success?
@success
end
#!/usr/bin/env bash
setxkbmap -query $(echo -e 'us\nir' | dmenu)
#!/usr/bin/env python3
"""A dmenu setxkbmap wrapper."""
import os
import subprocess
import re
import sys
dmenu_command = "dmenu"
setxkbmap_command = "setxkbmap"
# Maintainer: Knut Ahlers <knut at ahlers dot me>
# Contributor: Det <nimetonmaili g-mail>
# Contributors: t3ddy, Lex Rivera aka x-demon, ruario
# Check for new Linux releases in: http://googlechromereleases.blogspot.com/search/label/Stable%20updates
# or use: $ curl -s https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df | awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'
pkgname=google-chrome
pkgver=73.0.3770.80
pkgrel=1