Some CoffeeScript (verbosely commented for clarity)
# Override Rails handling of confirmation
$.rails.allowAction = (element) ->
# The message is something like "Are you sure?"
message = element.data('confirm')
require 'digest/sha1' | |
class Invite < ActiveRecord::Base | |
validates_presence_of :email, :on => :save, :message => "can't be blank" | |
validates_uniqueness_of :email, :on => :save, :message => "is already registered" | |
named_scope :unsent_invitations, :conditions => {:redeemed_at => nil, :invite_code => nil} | |
def invited? |
require 'rubygems' | |
require 'active_resource' | |
require 'basecamp' | |
require 'httparty' | |
require 'json' | |
GITHUB_USERNAME = '__GITHUB_USERNAME__' | |
GITHUB_PASSWORD = '__GITHUB_PASSWORD__' | |
GITHUB_ORG = '__GITHUB_ORG__' | |
GITHUB_REPO = '__GITHUB_REPO__' |
A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576
if ENV['USE_S3'] == 'true' | |
Paperclip::Attachment.default_options[:storage] = :fog | |
Paperclip::Attachment.default_options[:fog_credentials] = { provider: "AWS", aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'], aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] } | |
Paperclip::Attachment.default_options[:fog_directory] = ENV['FOG_BUCKET'] | |
Paperclip::Attachment.default_options[:path] = '/app/public/assets/products/:id/:style/:basename.:extension' | |
Paperclip::Attachment.default_options[:fog_host] = ENV['S3_HOST_ALIAS'] | |
Paperclip::Attachment.default_options[:url] = ':s3_alias_url' | |
Spree::Image.attachment_definitions[:attachment][:path] = 'public/assets/products/:id/:style/:basename.:extension' | |
else | |
Paperclip::Attachment.default_options[:storage] = :fog |
Задание
Реализовать на Ruby с использованием Rails приложение со следующим функционалом:
Требования
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
sudo npm uninstall npm -g
brew uninstall node
Then
sudo rm -rf /usr/local/lib/dtrace/node.d /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/nodemon /usr/local/bin/node /usr/local/include/node ~/.npm* ~/.node* /usr/local/share/man/*/node* /usr/local/share/man/*/npm*
#!/usr/bin/env ruby | |
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze | |
changed_files = `git status --porcelain`.split(/\n/) | |
unstaged_files = `git ls-files -m`.split(/\n/) | |
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED } | |
changed_files = changed_files.map { |f| f.split(" ")[1] } |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |