I hereby claim:
- I am trev on github.
- I am trevw (https://keybase.io/trevw) on keybase.
- I have a public key ASA_MrVzdOD_P5Av12r3MHZGLp63eH1Hgdvld9THynOmaQo
To claim this, I am signing this object:
# Ruby CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-ruby/ for more details | |
defaults: &defaults | |
working_directory: ~/split_app | |
parallelism: 2 | |
docker: | |
- image: circleci/ruby:2.5.0-node-browsers |
I hereby claim:
To claim this, I am signing this object:
// This modified snippet is from a function that accepts the current month(currentmonth) and period(period) and adds the period to the current month and lists every month within the new period. It can accept negative or positive periods. | |
function iterveningMonths(year, month, period) { | |
var movement = period < 0 ? -1 : 1; //Which way are we going? | |
var out = []; | |
var result; | |
for (var i = Math.abs(period); i !== 0; i--) { | |
month += movement; //Increment or decrement month | |
result = month % 12; //Check to see where that month is on a 12 month[0..11] period |
class Server | |
class << self | |
delegate :dl_private_key!, to: Figaro.env | |
SSH_KEY = { | |
key_data: [ dl_private_key! ], | |
keys: [], # Required or Net:SSH will search for machine keys | |
keys_only: true, | |
} | |
class LineItem < ActiveRecord::Base | |
belongs_to :order | |
has_many :passengers | |
end |
= simple_form_for @form, wrapper: :booking do |f| | |
.simple-group | |
%h3.small-title Your Personal Information | |
= f.simple_fields_for :line_items do |li| | |
= li.simple_fields_for :passengers do |pax| | |
.row | |
.col-md-12 | |
%h4= "Trip: #{Product.find(li.object.product_id).title}" | |
%h5= "Tell us about dude ##{pax.index + 1}" | |
= pax.input :first_name, placeholder: 'Big' |
Optimizing response time in SilverStripe using APC and Partial Caching
Customizing GridField columns. (Two methods)
$summary_fields
and define custom getter: $summary_fields = array('FullName' => 'Full Name');
public function getFullName() { return $this->FirstName . ' ' . $this->LastName; }
Use GridField setFieldFormatting()
to customize:
<?php | |
public function filterStuff() { | |
// Can't use Search Filter since the object has a base class of SiteTree | |
// $results = PostPage::get()->filter(array('Authors.URLSegment:ExactMatch' = 'Trev')); | |
// Lets go manually | |
$results = PostPage::get()->leftJoin( | |
'PostPage_Authors', | |
'"PostPage_Authors"."PostPageID" = "PostPage"."ID"' |
These instructions install ruby and rubygems from source, not from RPMs. For instructions on installing from RPMs, look at something like http://wiki.opscode.com/display/chef/Installation+on+RHEL+and+CentOS+5+with+RPMs or http://mykestubbs.com/blog/2010/03/chef-installation-on-centos-54.html