Skip to content

Instantly share code, notes, and snippets.

View kirkland's full-sized avatar

Robert Kaufman kirkland

View GitHub Profile
Delayed::Backend::ActiveRecord::Job.class_eval do
def self.build_ready_scope(worker, max_run_time)
ready_scope = ready_to_run(worker.name, max_run_time)
ready_scope = ready_scope.by_priority
ready_scope = ready_scope.where(
RandomUserIdQuery::SQL, db_time_now: db_time_now,
worker_name: worker.name,
locked_at_expired_at: db_time_now - max_run_time
)
def self.reserve(worker, max_run_time = Worker.max_run_time)
ready_scope = ready_to_run(worker.name, max_run_time)
ready_scope = ready_scope.by_priority
reserve_with_scope(ready_scope, worker, db_time_now)
end
function g() {
if [[ $# == '0' ]]; then
git status
else
case $1 in
fuss)
shift
git rebase -i HEAD~"$1";;
*)
git "$@";;
chpwd() {
ls
git status > /tmp/git_status_output.txt 2>&1
if [[ $? == 0 ]]; then
echo
git status
fi
}