Skip to content

Instantly share code, notes, and snippets.

View dsignr's full-sized avatar

Neya dsignr

View GitHub Profile
@dsignr
dsignr / index.md
Created October 20, 2015 08:43 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@dsignr
dsignr / gist:b372f74970525a38f3de
Created October 18, 2015 07:49 — forked from dhh/gist:1014971
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@dsignr
dsignr / index.css
Created June 28, 2014 09:34
Responsive fluid squares
/*-- credits: http://jsfiddle.net/josedvq/38Tnx/ --*/
.square-box{
position: relative;
width: 50%;
overflow: hidden;
background: #4679BD;
}
.square-box:before{
content: "";
@dsignr
dsignr / uri.js
Created June 25, 2014 16:45 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@dsignr
dsignr / JQuery simple Tab Plugin.coffee
Last active July 18, 2018 13:11
A simple Coffeescript snippet to implement tabs easily in your application
###
Disclaimer:
This gist is opinionated. It favors the usage of dashes over underscores.
http://stackoverflow.com/questions/7560813/why-are-dashes-preferred-for-css-selectors-html-attributes
License:
Free, Opensource, MIT
http://opensource.org/licenses/MIT
Usage:
Your HTML should be something like: