Skip to content

Instantly share code, notes, and snippets.

@hugodias
hugodias / 0000_packages.config
Created April 12, 2016 20:13 — forked from gcarrion-gfrmedia/0000_packages.config
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []
@hugodias
hugodias / install-redis.sh
Created April 12, 2016 19:54 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@hugodias
hugodias / sidekiq.config
Created March 24, 2016 18:15 — forked from RobertoSchneiders/sidekiq.config
Sidekiq Config for Elastic Beanstalk
# Sidekiq interaction and startup script
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
content: |
#!/bin/bash
. /opt/elasticbeanstalk/hooks/common.sh
. /opt/elasticbeanstalk/support/envvars
@hugodias
hugodias / realties_controller.rb
Last active March 23, 2016 15:57
Qual é a melhor maneira de alterar dentro params?
class RealtiesController < ApplicationController
before_action :set_realty, :only => [:update]
def update
@realty.status = 3
if @realty.update_attributes(realty_update_params)
redirect_to conta_imoveis_path
end
@hugodias
hugodias / digital_ocean_setup.md
Created February 29, 2016 19:15 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
@hugodias
hugodias / routes.rb
Last active October 29, 2015 19:04
Erro: Couldn't find Realty with id=archived
Profit::Application.routes.draw do
root :to => 'pages#index'
resources :realties do
collection do
get "/realties/archived", to: "realties#archived"
end
end
@hugodias
hugodias / twitter.json
Last active August 29, 2015 14:19 — forked from hrp/twitter.json
{
"text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...",
"truncated": true,
"in_reply_to_user_id": null,
"in_reply_to_status_id": null,
"favorited": false,
"source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>",
"in_reply_to_screen_name": null,
"in_reply_to_status_id_str": null,
"id_str": "54691802283900928",
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
# =============================================================
# REQUIREMENTS
# =============================================================
# - Heroku toolbelt installed in your system
# - A heroku remote named `staging`.
# - A heroku remote named `production`.
# =============================================================
namespace :h do
# -------------------------------------------------------------
angular.module('project', ['projectServices'])
.config ($routeProvider) ->
$routeProvider
.when('/login',
templateUrl: 'partials/login.html',
controller: LoginCtrl)
.when('/assignments',
templateUrl: 'partials/assignments.html',
controller: AssignmentListCtrl)
.otherwise(redirectTo: '/login')