var app = angular.module('app', []);
Using modules in views
<html ng-app="app"></html>
| // Assumes Bourbon - See http://bourbon.io/docs/#transform | |
| // To see it in action, check out http://codepen.io/dwayne/pen/gjDGx | |
| @mixin vertical-center { | |
| position: relative; | |
| top: 50%; | |
| @include transform(translateY(-50%)); | |
| } |
| #!/usr/bin/env python | |
| import sys | |
| import pandas as pd | |
| import pymongo | |
| import json | |
| def import_content(filepath): | |
| mng_client = pymongo.MongoClient('localhost', 27017) |
| class GroupersController < ApplicationController::Base | |
| def create | |
| @grouper = Grouper.new(leader: current_member) | |
| if @grouper.save | |
| ConfirmedGrouperEmails.new(@grouper).deliver | |
| AssignBarForGrouper.enqueue(@grouper.id) | |
| redirect_to home_path | |
| else |
| class GroupersController < ApplicationController::Base | |
| def create | |
| @grouper = Grouper.new(leader: current_member) | |
| if @grouper.save | |
| confirm_grouper_via_emails(@grouper) | |
| enqueue_bar_assignment(@grouper) | |
| redirect_to home_path | |
| else |
| // http://css-tricks.com/snippets/css/exactly-center-an-imagediv-horizontally-and-vertically/ | |
| @mixin exact-center($width, $height) { | |
| width: $width; | |
| height: $height; | |
| position: absolute; | |
| left: 50%; | |
| top: 50%; | |
| margin-left: -$width / 2; | |
| margin-top: -$height / 2; | |
| } |
Author: Ari Lerner.
AngularJS offers a single framework that can be used to build dynamic, client-centric applications. It provides:
| /** @jsx React.DOM */ | |
| var STATES = [ | |
| 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
| 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
| 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
| 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
| ] | |
| var Example = React.createClass({ |
| class UsersController < ApplicationController | |
| before_action :set_user, only: [:show, :edit, :update] | |
| before_action :require_same_user, only: [:edit, :update] | |
| def index | |
| @user = User.all | |
| end | |
| def show |
| <div class='well'> | |
| <%= form_for @private_message, url: private_messages_user_path(@user) do |f| %> | |
| <div class="control-group"> | |
| <%= f.label :receiver_uid %> | |
| </div> | |
| <div class="control-group"> | |
| <%= f.label :subject %> | |
| <%= f.text_field :subject %> | |
| </div> | |
| <div class="control-group"> |