Skip to content

Instantly share code, notes, and snippets.

View Nosfheratu's full-sized avatar
🏠
Working from home

Fernando Serapio Nosfheratu

🏠
Working from home
View GitHub Profile
/* Requirements install git and curl */
/* installing rbenv */
curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
/* add this instead of generated stuff "PREPEND" the echo wordings to ~/.profile */
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
@Nosfheratu
Nosfheratu / setup.md
Last active December 15, 2015 01:49 — forked from georgeredinger/setup.md

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev

@Nosfheratu
Nosfheratu / gist:4572534
Created January 19, 2013 12:54
Highlights active url .nav classes matching current url path
$(document).ready(function(){
if(location.pathname != "/"){
$('.nav li a[href^="/' + location.pathname.split("/")[1] + '"]').parent().addClass('active');
}
else
$('.nav li a:eq(0)').parent().addClass('active');
});
@Nosfheratu
Nosfheratu / Gemfile
Last active December 11, 2015 08:19
Creating a simple User model with secure password and image profile (gravatar)
# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
@Nosfheratu
Nosfheratu / NHibernateRepository.cs
Last active December 10, 2015 12:38
Generic repository pattern implementation for NHibernate
public interface IRepository<T>
{
IEnumerable<T> GetAll();
T GetByID(int id);
T GetByID(Guid key);
void Save(T entity);
void Delete(T entity);
}
public class Repository<T> : IRepository<T>