Skip to content

Instantly share code, notes, and snippets.

@eliza-abraham
eliza-abraham / Gemfile
Created November 11, 2013 09:16 — forked from datt/Gemfile
Using Internationalisation in JS files in a Rails Project
#NOTE Rails I18n translations on the Javascript.
gem 'i18n-js','2.1.2'
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
<virtualhost *:80>
ServerName app.com
ServerAlias www.app.com
DocumentRoot /var/www/html/blog/public # <-- be sure to point to 'public'!
setenv RAILS_ENV production
<Directory /var/www/html/blog/public>
AllowOverride All
RailsEnv production
</Directory
ErrorLog /var/log/apache2/blog_error_log

Models, Roles, Decorators, and Interactions

A modest alternative to DCI that might be worth further thought

One of the problems with advancing the discussion on DCI is that we lack a comparable alternative pattern that has the same goals, but favors a low ceremony approach. The closest thing we have to that is Rails concerns, but they are more like distant relatives of the DCI concepts rather than first cousins, and that makes comparisions between the two approaches not especially fruitful.

I am considering the idea of experimenting with my own paradigm that captures the intent and purity of DCI, but with the convenience of concerns. Please note that this is just the starting point of a conversation, it is NOT a promise of comercially available cold fusion or a cure for cancer. It's just a gist with an idea on it I'd like to hear your thoughts on.

What if we had a top-level topology that was split into Models, **Rol

@eliza-abraham
eliza-abraham / Common Issues & Fixes on Ubuntu
Last active December 27, 2015 23:59
Issues that occur on Ubuntu
1. Heroku Toolbelt Issue
2. MongoDb Issue
3. MergeList /var/lib/apt/lists Issue
4. Host 'host_name' is blocked
@eliza-abraham
eliza-abraham / New Orphan Branch
Last active December 27, 2015 23:59
Create new local branch for existing remote branch
Clone the target repository to your local computer.
$ git clone git@github.com:<username>/<project name>.git
Create a new oprhan branch
$ git checkout --orphan NEWBRANCH
Delete everything in it.
$ git rm -rf .
Merge/Pull the remote branch orphan branch into the local orphan branch
@eliza-abraham
eliza-abraham / Remove gitignore'd file
Created November 11, 2013 09:47
Removing ignored file from the repository
$git rm -r --cached some-directory
$git commit -m 'Remove the now ignored directory "some-directory"'
$git push origin master
@eliza-abraham
eliza-abraham / Git Diff
Last active December 31, 2015 14:59
Differences in files between different branches/commits
Compare the differences between two branches
To produce the diff between the tips of the two branches.
$ git diff branch_1..branch_2
To find the diff from their common ancestor to test, you can use three dots instead of two:
$git diff branch_1...branch_2
In a specific file
&$git
@eliza-abraham
eliza-abraham / Switching Commits
Created January 29, 2014 06:03
Switching Between Commits
1) Get the required commit hash from git log
2) Use git checkout commit_hash
3) Run the application (There will be no un-tracked files)
4) git checkout branch_name : Come back to the latest commit
@eliza-abraham
eliza-abraham / Overriding Active Admin
Last active January 4, 2016 21:59
Overriding Active Admin
# Breadcrumbs
## Remove breadcrumbs for all pages of a particular Model
config.breadcrumb = Proc.new{ [] }
# Filters
## Search for multiple columns
filter :first_name_or_last_name