Skip to content

Instantly share code, notes, and snippets.

View christianrojas's full-sized avatar

Christian Rojas christianrojas

View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active July 23, 2024 14:51
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@thesoftwarejedi
thesoftwarejedi / clear-old-slack.py
Last active December 19, 2023 12:02
delete old slack files
import requests
import json
import calendar
from datetime import datetime, timedelta
#token from https://api.slack.com/web
_token = "YOUR TOKEN HERE"
_domain = "YOUR SUB DOMAIN HERE"
if __name__ == '__main__':
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@Djuki
Djuki / deploy.sh
Last active August 29, 2015 14:04
Deploy script for Laravel apps
# stop script on error signal
set -e
# delete deployment folder if script exit before end last time
if [ -d "/home/forge/deployment" ]; then
rm -R /home/forge/deployment
fi
# set up your env variables if your app using them
export DB_HOST=localhost
@apat
apat / nav_laravel.blade.php
Last active March 20, 2021 19:50
Menu Navigation Active Class - Laravel 4.x
<!-- Active navigation links to the menu -->
<nav>
<ul>
<!-- First active class -->
<li class="{{ Request::is( '/') ? 'active' : '' }}">
<a href="{{ URL::to( '/') }}">Home</a>
</li>
<li class="{{ Request::is( 'about-us') ? 'active' : '' }}">
<a href="{{ URL::to( 'about-us') }}">About us</a>
</li>
@TrevorS
TrevorS / resque.rake
Created February 27, 2014 16:24
Add Resque and Resque scheduler rake tasks.
require 'resque/tasks'
require 'resque_scheduler/tasks'
def run_worker(queue, count = 1)
puts "Starting #{count} Resque worker(s) with QUEUE: #{queue}."
ops = { pgroup: true, err: [Rails.root.join('log', 'workers_error.log'), 'a'],
out: [Rails.root.join('log', 'workers.log'), 'a']}
env_vars = { 'QUEUE' => queue.to_s }
count.times do
@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@kxhitiz
kxhitiz / gist:4952218
Created February 14, 2013 11:26
HTTParty Header Token Authentication
HTTParty.get "http://localhost:3000/teams.json", :headers=>{"Authorization"=>"Token token=\"a8d8ce14d2402a2e1912c25f39df770b\""}