This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/models/profile.erb | |
class Profile < ActiveRecord::Base | |
belongs_to :user | |
# Paperclip | |
has_attached_file :avatar, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile < ActiveRecord::Base | |
belongs_to :user | |
attr_accessible :avatar, :user | |
# Paperclip | |
has_attached_file :avatar, | |
:styles => { | |
:thumb => "45x45#", | |
:small => "100x100#" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, :lockable and :timeoutable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable, :confirmable, :token_authenticatable, | |
:oauthable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :has_username, :is_admin, :profile | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game < ActiveRecord::Base | |
belongs_to :league | |
has_and_belongs_to_many :my_players, :class_name=>"Player" | |
has_and_belongs_to_many :their_players, :class_name=>"Player" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Application.java | |
public class Application extends Controller { | |
protected static void respondWith(Object... args){ | |
try { | |
render(args); | |
}catch(TemplateNotFoundException e) { | |
if(request.format == "json") { | |
renderJSON(args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Articles extends Application { | |
public static void index() { | |
render(); | |
} | |
public static void create() { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers; | |
import java.io.Serializable; | |
import java.util.*; | |
import play.Logger; | |
import play.classloading.enhancers.ControllersEnhancer.ControllerSupport; | |
import play.classloading.enhancers.LocalvariablesNamesEnhancer.LocalVariablesNamesTracer; | |
import play.classloading.enhancers.LocalvariablesNamesEnhancer.LocalVariablesSupport; | |
import play.exceptions.TemplateNotFoundException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers; | |
import java.io.Serializable; | |
import java.util.HashMap; | |
import java.util.Map; | |
import play.Logger; | |
import play.classloading.enhancers.ControllersEnhancer.ControllerSupport; | |
import play.classloading.enhancers.LocalvariablesNamesEnhancer.LocalVariablesNamesTracer; | |
import play.classloading.enhancers.LocalvariablesNamesEnhancer.LocalVariablesSupport; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String test = "one.two.three"; | |
String[] split = test.split("."); | |
Logger.info(java.util.Arrays.toString(split)); // prints: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/vine/public; | |
location / { | |
proxy_pass http://localhost:9000; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
} | |
} |