Skip to content

Instantly share code, notes, and snippets.

<div class="gender_container">
<%= f.collection_radio_buttons :gender, [["F", t("collection.gender.female_html") ], ["M", t("collection.gender.male_html")]], :first, :last, label: false, wrapper: false %>
</div>
@seoyoochan
seoyoochan / Gemfile
Last active August 29, 2015 14:06 — forked from cblunt/Gemfile
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@seoyoochan
seoyoochan / index.md
Last active August 29, 2015 14:10 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@seoyoochan
seoyoochan / signup.js
Last active August 29, 2015 14:24
Google Signup Validation (email, username, password) javascript
define(["marionette", "backbone", "templates/templates"], function(Marionette, Backbone, templates){
var value;
var field;
var alert_label;
var url = "http://api.localhost.dev:3000/v1";
//var url = "http://api.bitsnut.com/v1";
var Model = Backbone.Model.extend({
defaults: {
<div class="Modal-Background toggle-Modal">
<div class="Center-Block Absolute-Center is-Fixed is-Variable Modal" id="Fixed-Modal">
<div class="Center-Content">
<h4 class="Title">Absolute Center.</h4>
<p>This box is absolutely centered within the viewport, horizontally and vertically, using only CSS.</p>
<p><a href="#" class="Shaw-Button trigger-Resize">Resize Me!</a></p>
<p><a href="#" class="Shaw-Button toggle-Modal">Close Modal</a></p>
<!-- We want to center our <ul> into the container REGARDLESS of the number of <li> inside our <ul> -->
<h1 id="title">How to center floating elements</h1>
<p id="subtitle">Without setting a width <b>&</b> Regardless of the number of children</p>
<section id="container">
<div class="float_center">
<ul class="child">
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
@seoyoochan
seoyoochan / center_no_width
Created July 13, 2015 05:13
Centering element without width
<div class="container">
<div class="center_div">
</div>
</div>
.container{
float: left;
@seoyoochan
seoyoochan / style.css
Created July 14, 2015 09:11
How to center absolute positioned element
.container
{
position: absolute;
width:40%;
margin: 0 auto;
left: 0;
right: 0;
}
// set left, right to 0 and specify width!
@seoyoochan
seoyoochan / server-git.conf
Created December 24, 2015 05:24 — forked from massar/server-git.conf
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}