Skip to content

Instantly share code, notes, and snippets.

View supremebeing7's full-sized avatar
💭
I may be slow to respond.

Mark J. Lehman supremebeing7

💭
I may be slow to respond.
View GitHub Profile
@supremebeing7
supremebeing7 / big-rails.md
Last active May 20, 2022 23:10
Notes from RailsConf2022 Sessions

Laying the cultural and technical foundation for Big Rails

As applications built on Rails get larger and larger, and more and more engineers work in the same monolith, our community needs to think more about what sort of tooling and architectural changes will help us continue to scale. This talk shares ideas around a toolchain, and more importantly, the social and cultural programs needed to support that toolchain, that can be used to help engineers in an ever-growing Rails codebase continue to have high velocity, manage their complexity, and claim ownership over their own business subdomains.

Alex Evanczuk, Gusto

https://engineering.gusto.com/laying-the-cultural-and-technical-foundation-for-big-rails/

#!/bin/bash
update_chromedriver() {
local version=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
curl -sS https://chromedriver.storage.googleapis.com/$version/chromedriver_mac64.zip > chromedriver_mac64.zip
unzip chromedriver_mac64.zip
rm chromedriver_mac64.zip
mv -f chromedriver /usr/local/bin/chromedriver
chmod +x /usr/local/bin/chromedriver
chromedriver -v
@supremebeing7
supremebeing7 / .gitconfig
Created January 25, 2022 01:13 — forked from simonwagner/.gitconfig
Fixup alias for simply fixing a commit.
#This will the fixup command to git
#git fixup $commit will use your current index to fixup the specified commit
#This is done by doing git commit --fixup $commit and then using rebase with autosquash
#Based upon http://stackoverflow.com/a/21148981/460564
[alias]
fixup = "!sh -c '(git diff-files --quiet || (echo Unstaged changes, please commit or stash with --keep-index; exit 1)) && COMMIT=$(git rev-parse $1) && git commit --fixup=$COMMIT && git rebase -i --autosquash $COMMIT~1' -"
@supremebeing7
supremebeing7 / console.rb
Created July 13, 2018 05:00
datetime comparison
001 > User.where('created_at >= ?', '2018-07-12T17:12:37.673+02:00')
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (created_at >= '2018-07-12T17:12:37.673+02:00') LIMIT ? [["LIMIT", 11]]
=> #<ActiveRecord::Relation [#<User id: 1, username: "stuff", email: "m@c.com", password_hash: "4dc594e728edf9acd0148eb195e09af68a082ff6", password_salt: "9225fe40b42187ff1fc440b2c32cf2fba67e3be7", created_at: "2018-07-13 04:56:44", updated_at: "2018-07-13 04:56:44">]>
002 > User.where('created_at <= ?', '2018-07-12T17:12:37.673+02:00')
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (created_at <= '2018-07-12T17:12:37.673+02:00') LIMIT ? [["LIMIT", 11]]
=> #<ActiveRecord::Relation []>
003 > user.created_at
=> Fri, 13 Jul 2018 04:56:44 UTC +00:00
@supremebeing7
supremebeing7 / parser.rb
Created April 22, 2018 17:41
roo gem parse issues
require 'roo'
csv = Roo::Spreadsheet.open("sample.csv")
csv.parse
# => [["row1col1", "row1col2", "row1col3"],
# ["row2col1", "row2col2", "row2col3"],
# ["row3col1", "row3col2", "row3col3"]]
csv.parse(headers: true)
@supremebeing7
supremebeing7 / set-modified-to-creation-date.sh
Created November 14, 2016 21:34
Set file modified date to creation date for fileset
# This doesn't work in its current form... I don't remember what the problem is
for i in $( ls ); do
if [ "$i" == "DSC_0518.JPG" ]; then
modified=\"$(GetFileInfo -m $i)\"
SetFile -d \'$modified\' $i
fi
done
count=1
for i in $( ls ); do
require 'mina/git'
require 'json'
set :domain, '0.0.0.0'
set :user, 'nodejs'
set :deploy_to, '/home/nodejs/api'
set :repository, 'git@.../api.git'
set :branch, 'master'
set :shared_paths, [ 'tmp' ]
set :term_mode, :pretty
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@supremebeing7
supremebeing7 / .bash_profile
Created December 9, 2015 18:33
git aliases
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gcm='git commit -m'
alias gd='git diff'
alias gco='git checkout '
alias gcob='git checkout -b '
alias got='git '
# config/locales/en.yml
en:
exception:
show:
not_found:
title: "Not Found"
description: "The page you were looking for does not exists."
internal_server_error:
title: "Internal Server Error"