- Add initializer to
config/application.rb
- Add new class to
app/models/spree/calculators/[class_name].rb
- Add logic to class file
Class must have the following methods:
def self.description
"Custom FlexiRate"
end
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
=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| |
cd /tmp | |
refinerycms bar | |
cd bar | |
git init . | |
git add . | |
git commit -a -m "Hide these files" | |
rake refinery:override view=**/* | |
rake refinery:override controller=**/* | |
rake refinery:override model=**/* | |
git add -N . |
config/application.rb
app/models/spree/calculators/[class_name].rb
Class must have the following methods:
def self.description
"Custom FlexiRate"
end
class SessionsController < ApplicationController | |
skip_before_filter :verify_authenticity_token, only: :saml | |
def new | |
request = Onelogin::Saml::Authrequest.new | |
settings = saml_settings | |
request_doc = request.create_authentication_xml_doc(settings) | |
request_str = request_doc.to_s #.force_encoding("UTF-8") | |
logger.debug request_str |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)# | Metric | Haml | Slim | Winner |
---|---|---|---|---|
1 | Issues | Slim | ||
2 | Stars | Slim | ||
3 | Quality | -- | Haml | |
4 | Test Coverage | ![Code Climate coverage](https://i |
# USAGE: | |
# rubocop -r ./tmp/rubocop_default_args_assignment.rb --only Style/RubocopDefaultArgsAssigmment app/ | |
# | |
# Finds method definitions like `def my_thing(date = date)` which are circular references in ruby 2.3.1 | |
# Change them to `def my_thing(date = self.date)` to maintain behaviour | |
# | |
module RuboCop | |
module Cop | |
module Style | |
# Check if default args are circular assignments |
- run: #STABLE | |
name: Install Chromedriver latest version | |
command: | | |
sudo apt-get update | |
sudo apt-get install lsb-release libappindicator3-1 | |
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo dpkg -i google-chrome.deb | |
sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome | |
rm google-chrome.deb |
On March 22, npm fired several members of the open source and community team for discussing workplace conditions and other labor organizing activities. As a result, core employee contributors to the npm cli were removed from the project, and others have left in solidarity or put their work on hold.
Multiple claims were filed with the NLRB on this matter. The NLRB has investigated and found sufficient evidence of validity to proceed. The National Labor Relations Act of 1935 protects US employees' right to engage in discussions of workplace concerns without threat of retaliation -- and awareness of the importance of how we treat each other is something I valued so much in collaborating with the cli team. How can we work together if we aren't free to discuss what we need?
It's disappointing for all of us to find the work we were doing interrup