Skip to content

Instantly share code, notes, and snippets.

View adrianvalenz's full-sized avatar
💭
working on Ruby stuff

Adrian Valenzuela adrianvalenz

💭
working on Ruby stuff
View GitHub Profile
@adrianvalenz
adrianvalenz / spec_dispatches_crud.rb
Created September 21, 2018 18:13
sample tests in rails
require 'rails_helper'
RSpec.describe "User creates dispatches" do
before(:each) do
user = FactoryBot.create(:user)
login_as(user, scope: :user)
end
it "user visits dashboard dispatches" do
visit dashboard_path
"colorscheme zenburn
"dracula theme
"packadd! dracula
"colorscheme dracula
"let g:dracula_italic = 0
" material theme
"let g:material_theme_style = 'ocean'
"let g:material_terminal_italics = 1
"colorscheme material
@adrianvalenz
adrianvalenz / .zshrc
Created October 20, 2020 21:21
.zshrc-2020
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/adrianvalenz/.oh-my-zsh"
# Path to MacVim script to open mvim in terminal
export PATH=/Applications/MacVim.app/Contents/bin/:$PATH
# Use PHP
@adrianvalenz
adrianvalenz / ..dracula setup for vim, zsh, & tmux
Last active December 1, 2020 09:04
so dope...even tmux has the dracula color schemes.
so dope...even tmux has the dracula color schemes.
@adrianvalenz
adrianvalenz / tmux.md
Created October 22, 2021 09:33 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

class Conversation < ActiveRecord::Base
enum status: [:active, :archived], _suffix: true
enum comments_status: [:active, :inactive], _prefix: :comments
end
conversation.active_status!
conversation.archived_status? # => false
conversation.comments_inactive!
conversation.comments_active? # => false
class SourdoughFormBuilder < ActionView::Helpers::FormBuilder
def check_box(attribute, options={})
super(attribute, options.reverse_merge(class: "check-box-styles"))
end
def date_field(attribute, options={})
super(attribute, options.reverse_merge(class: "date-field-styles"))
end
def datetime_field(attribute, options={})
# frozen_string_literal: true
require 'pry'
a = [
# "1\nJubil[A]ee, jubilee,\nJubilee, jubilee,\nPraise God for the jubi[E]lee!\nWords of grace, words of grace,\nWords of grace, words of grace!\nTime ac[E7]cept'ble, the year of jubil[A]ee.\nLost possession recovered,\n[A7]From all bondage set f[D]ree,\n[E]In God's house reu[A]nited—\nOur [D]Lord proclaims the j[E7]ubil[A]ee!\n\n2\nFather's house, Father's house,\nFather's house, Father's house,\nReturned to the Father's house,\nGod did run, God did run,\nGod did run, God did run,\nFell on our neck and kissed us tenderly.\nIn Christ clothed and accepted,\nNo more “pigs” food for me!\nFattened calf now enjoying—\nOur God proclaims the jubilee!\n\n3\nJubilee, jubilee,\nJubilee, jubilee,\nGospel of the jubilee!\nVessels we, vessels we,\nVessels we, vessels we,\nChosen vessels, receiving His mercy.\nPoor, blind, empty, no longer,\nGlorious riches have we!\nTo all th' poor and afflicted—\nWe now proclaim the jubilee!",
# Psa. 126:1-6\n\n1\nWhen the [D]Lord tur
@adrianvalenz
adrianvalenz / .tmux.conf
Last active October 21, 2023 02:02
tmux conf with color schemes kanagawa, iceberg, rosepine configs
# set -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"
set -g prefix C-f
unbind C-b
bind-key C-a send-prefix
unbind r
bind r source-file ~/.tmux.conf
@adrianvalenz
adrianvalenz / search.rake
Created May 1, 2024 00:01
rake task for Melisearch
namespace :search do
# bundle exec rake search:index_all --trace
task reindex_all: :environment do
klasses = [Listing User Post]
klasses.each do |klass|
klass.reindex!
end
puts "Reindexed all classes"
end