Skip to content

Instantly share code, notes, and snippets.

View yelinaung's full-sized avatar
🏠
Working from home

Ye Lin Aung yelinaung

🏠
Working from home
View GitHub Profile
@yelinaung
yelinaung / gist:5915722
Created July 3, 2013 05:46
Java Date Compare
package introtocs;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class DateCompare {
/**
* @param args
.pure-button-success,
.pure-button-error,
.pure-button-warning,
.pure-button-secondary {
color: white;
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.pure-button-success {
background: rgb(28, 184, 65); /* this is a green */
# Controller
def index
@locations = Location.all
respond_to do |format|
format.json { render json: @locations }
end
end
@yelinaung
yelinaung / gist:5763890
Created June 12, 2013 09:08
Application Controller
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :get_menu_ready
def after_sign_in_path_for(resource)
session[:return_to] = request.fullpath if request.get? and controller_name != "user_sessions" and controller_name != "sessions"
end
def after_sign_out_path_for(resource)
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like