Skip to content

Instantly share code, notes, and snippets.

View gabrielrubens's full-sized avatar

Gabriel Rubens gabrielrubens

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@slok
slok / jboss_apache.md
Created December 31, 2011 09:06
Setup for jboss 7 with apache and mod_cluster in ubuntu 11.10

Preparing Jboss environment

Create Jboss user and group

Create a group for a system user (daemnos and program users like www-data, mysql...)

# addgroup --system jboss

Create a user (system user, without home -> See below the command, to the jboss group and no login shell)

@yincrash
yincrash / Google2APi.java
Created April 22, 2012 17:22
Google OAuth2.0 for scribe-java
package org.scribe.builder.api;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.scribe.exceptions.OAuthException;
import org.scribe.extractors.AccessTokenExtractor;
import org.scribe.model.OAuthConfig;
import org.scribe.model.OAuthConstants;
import org.scribe.model.OAuthRequest;
@usamadar
usamadar / HttpDigestAuthServlet.java
Created June 11, 2012 19:17
HTTP Servlet Sample Implmentation of HTTP Digest Authentication RFC 2617
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.http.authenticate;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
@danieldbower
danieldbower / javaSwitch.sh
Created August 16, 2012 17:43
Switch Java Versions on Debian/Ubuntu
#!/bin/sh
clear
f_o6 () {
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64;
sudo update-alternatives --set java /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java;
}
f_s6 () {
@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
@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
@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;
@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:

@gokulkrishh
gokulkrishh / media-query.css
Last active May 17, 2024 04:45
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */