Used to provide structural templates.
Pattern
t-template-name
t-template-name--modifier-name
t-template-name__subcomponent-name--subcomponent-modifier-name
| # Guide | |
| # Configure the essential configurations below and do the following: | |
| # | |
| # Repository Creation: | |
| # cap deploy:repository:create | |
| # git add . | |
| # git commit -am "initial commit" | |
| # git push origin master | |
| # | |
| # Initial Deployment: |
| # put this in an initializer | |
| # a Rails 3.2 addendum for: http://accuser.cc/posts/1-rails-3-0-exception-handling | |
| class MyShowExceptions | |
| def initialize() | |
| @@rescue_responses = Hash.new(:internal_server_error) | |
| @@rescue_responses.update({ | |
| 'ActionController::RoutingError' => :not_found, | |
| 'AbstractController::ActionNotFound' => :not_found, | |
| 'ActiveRecord::RecordNotFound' => :not_found, |
| source :rubygems | |
| # We are not loading Active Record, nor Active Resources etc. | |
| # We can do this in any app by simply replacing the rails gem | |
| # by the parts we want to use. | |
| gem "actionpack", "~> 3.2" | |
| gem "railties", "~> 3.2" | |
| gem "tzinfo" | |
| # Let's use thin |
| // FacesContext | |
| FacesContext facesCtx = FacesContext.getCurrentInstance(); | |
| // find UIComponent | |
| UIComponent input = facesCtx.getViewRoot().findComponent("f1"); | |
| // change the locale | |
| facesCtx.getViewRoot().setLocale( Locale.ENGLISH); | |
| // el expression |
| def icon(name, size=1) | |
| #icon("camera-retro") | |
| #<i class="icon-camera-retro"></i> | |
| html = "<i class='icon-#{name}' " | |
| html += "style='font-size:#{size}em' " | |
| html += "></i>" | |
| html.html_safe | |
| end | |
| =semantic_form_for [:admin, @dog], validate: true, html: {multipart: true} do |f| | |
| =f.inputs do | |
| =f.input :name | |
| =f.input :kennel_name | |
| =f.input :birthdate | |
| =f.input :gender, as: :radio, collection: {'Tik' => 'F', 'Hane' => 'M'} | |
| =f.input :father_id, as: :select, collection: @dogs | |
| =f.input :mother_id, as: :select, collection: @bitches | |
| =f.semantic_fields_for :pictures do |pic| |
Adobe Edge Inspect Used while working on mobile/responsive sites to view natively on iPhone, updates in real time. https://chrome.google.com/webstore/detail/adobe-edge-inspect/ijoeapleklopieoejahbpdnhkjjgddem
Benchwarmer This has replaced my pinned Dribbble tab. "New tab" extension, no URL bar icon, transforms your new tab's background into a list of Dribbble popular/everyone/debut/following (you pick) shots. https://chrome.google.com/webstore/detail/benchwarmer-the-dribbble/lhdjhhpjicomphhjpehdhjenbaamdpnn
Bitly Used with custom .htaccess rule and vanity domain to shorten links with 2 clicks.
| [Time, Date].map do |klass| | |
| klass::DATE_FORMATS[:variable] = lambda do |t| | |
| date = | |
| case | |
| # display today's date as "today" | |
| when t >= Date.today then "today" | |
| # display yesterday's date as 'Yesterday' | |
| when (t >= Date.yesterday and t <= Date.today) then "yesterday" | |
| # otherwise, display date: eg. Mon 4th June | |
| else |