Skip to content

Instantly share code, notes, and snippets.

@roloenusa
roloenusa / herokudeploy.sh
Created June 30, 2019 01:29
Deploys an application on a folder to heroku.
#!/bin/bash
# Constants
# Variables
folder=
herokuapp=
init=
commit=`git rev-parse --short HEAD`
@roloenusa
roloenusa / installing_cassandra.md
Created June 25, 2019 17:24 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@roloenusa
roloenusa / utilities.java
Last active April 25, 2019 18:06
Normalize and Heatmap formulas.
class Utilities
{
/**
* Normalize the data point between 0 - 1. The data is weighted to prop up
* smaller numbers to provide a more interesting spread.
* @param The normalized data point value.
* @return The weighted value.
*/
public static Float normalize(float point, int max, int min)
{
@roloenusa
roloenusa / keybinds.json
Last active January 3, 2019 18:09
Sublime Text Keybinds
[
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+0"], "command": "reset_font_size" },
{ "keys": ["super+k","super+w"], "command": "destroy_pane", "args": {"direction": "self"}},
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
]
@roloenusa
roloenusa / settings.json
Created January 3, 2019 18:08
Sublime Text Settings
{
"caret_extra_width": 1,
"color_scheme": "Packages/Twilight+/Twilight+.tmTheme",
"file_exclude_patterns":
[
"*.log"
],
"folder_exclude_patterns":
[
".svn",
@roloenusa
roloenusa / git_aliases.sh
Last active February 23, 2018 21:58
Git Aliases
git config --global alias.lol "log --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative"
git config --global alias.lolme "log --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative --author=$(git config user.email)"
git config --global alias.me "whatchanged --graph --pretty=format:'%C(bold blue)%h%Creset %C(bold green)<%an>%Creset%Cgreen (%cr)%Creset%C(yellow)%d%Creset %s' --abbrev-commit --date=relative --author=$(git config user.email)"
@roloenusa
roloenusa / Round borders
Created July 31, 2011 01:09
CSS Round border
.round {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
@roloenusa
roloenusa / Ruby: Rspec
Created July 27, 2011 17:54
Ruby: Generating rspec
rails generate rspec:install
@roloenusa
roloenusa / Ruby: Uniqueness Key
Created July 25, 2011 04:47
Ruby: Add a uniqueness key to a db.
# rails generate migration add_email_uniqueness_index
class AddEmailUniquenessIndex < ActiveRecord::Migration
def self.up
# add_index to :users. to :email, add a unique constriction.
add_index :users, :email, :unique => true
end
def self.down
remove_index :users, :email
@roloenusa
roloenusa / Ruby
Created July 25, 2011 05:18
Ruby: Adding a column to a existing table.
# -- Look at the name "add password to the table Users" with a encrypted_password column
# rails generate migration add_password_to_users encrypted_password:string
class AddPasswordToUsers < ActiveRecord::Migration
def self.up
add_column :users, :encrypted_password, :string
end
def self.down