Skip to content

Instantly share code, notes, and snippets.

View gabrielrubens's full-sized avatar

Gabriel Rubens gabrielrubens

View GitHub Profile
@tbcooney
tbcooney / business_hours.rb
Created August 21, 2019 04:07
Serialization TimeOfDay with Rails and jsonb
#!/usr/bin/env ruby
# Supplies TimeOfDay class that includes parsing, strftime, comparison, and arithmetic
gem 'tod', '~> 2.2'
ActiveRecord::Schema.define do
add_column :businesses, :force => true do |t|
t.jsonb :business_hours
end
end
@alexishida
alexishida / rbenv-ruby-rails-install.sh
Last active March 25, 2024 13:18
Script to install rbenv, Ruby, nodejs and yarn
#!/bin/bash
#---------------------------------------------------------------------------------------
# Script to install rbenv, Ruby, nodejs and yarn
# Source: https://gist.github.com/alexishida/655fb139c759393ae5fe47dacd163f99
#
# Author: Alex Ishida <alexishida@gmail.com>
# Version: 1.5.7 - 25/03/2024
#---------------------------------------------------------------------------------------
#
# HOW TO INSTALL A SCRIPT
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@clodo
clodo / gist:52cb1f3989c2cb03c7033018257dfdbf
Last active January 13, 2017 15:22
Agile in Corporate books
Reinventing Organizations - Frederic Laloux
Lean Enterprise - Jez Humble, Joanne Molesky, Barry O'Reilly
Organize for Complexity - Niels Pflaeging
The DevOps Handbook - Gene Kim, John Willis, Patrick Debois, Jez Humble
Agile IT Organization Design - Sriram Narayan
It's your ship - D. Michael Abrashoff
Agile Software Development with Distributed Teams - Jutta Eckstein
Agile Software Development in the Large: Diving Into the Deep - Jutta Eckstein
No Excuses Management - T. J. Rogers of Cypress Semiconductor
The Enterprise and Scrum - Ken Schwaber
@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

@gokulkrishh
gokulkrishh / media-query.css
Last active May 8, 2024 06:59
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@jvenezia
jvenezia / rails_mailer_structure.md
Last active January 4, 2023 13:44
Rails mailer structure

Rails mailer structure

Your application is growing, and you are starting to have a complex mailing system: notification emails, retention emails, misc user emails, admin emails, etc...

It's time to clean up your mailers !

Existing mailer

You may already have a single mailer, responsible of every emails, like this one:

@juliano
juliano / ParametersValidatorInterceptor.java
Last active December 16, 2015 23:21
Interceptor que verifica se os parâmetros informados estão de acordo com a anotação @whitelist
import static br.com.caelum.vraptor.util.collections.Filters.hasAnnotation;
import static com.google.common.collect.Iterables.any;
import static java.util.Arrays.asList;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
import br.com.caelum.vraptor.InterceptionException;
import br.com.caelum.vraptor.Intercepts;
@ChangJoo-Park
ChangJoo-Park / gist:5443017
Last active January 29, 2019 20:55
# Ubuntu 13.04 , linux mint install RVM with Ruby 2.0.0-p353 , Rails 4.0.0
# If you meet install errors, see abid-hussain's comment
sudo apt-get --force-yes install build-essential openssl libreadline6 libreadline6-dev curl git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
&&
\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
@bueltge
bueltge / .bashrc
Last active September 7, 2016 14:16
Use Solarized colors on Gnome terminal with colorized support for git branches SEE the Steps on the first line inside the files for the right order of doing! 1. Copy and paste the following directly into your terminal and the color scheme will be updated instantly. 2. Install the correct dircolors + set to autoload 3. Copy my .bashrc or add to y…
# Step 3.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options