Skip to content

Instantly share code, notes, and snippets.

@hugodias
hugodias / launch_sublime_from_terminal.markdown
Created September 28, 2012 14:44 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

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')
# =============================================================
# REQUIREMENTS
# =============================================================
# - Heroku toolbelt installed in your system
# - A heroku remote named `staging`.
# - A heroku remote named `production`.
# =============================================================
namespace :h do
# -------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@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",
@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 / 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

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@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 / 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 / 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 "*****************************************"