Пример из pepegramming канала
Есть экшен в рельсе, который создает инвойс:
def create
invoice = Invoice.new(params[:invoice])
if invoice.save
##################### | |
# | |
# Use this with or without the .gitattributes snippet with this Gist | |
# create a fixle.sh file, paste this in and run it. | |
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) | |
# This Gist normalizes handling by forcing everything to use Unix style. | |
##################### | |
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF |
Пример из pepegramming канала
Есть экшен в рельсе, который создает инвойс:
def create
invoice = Invoice.new(params[:invoice])
if invoice.save
Справочник переехал: https://github.com/hflabs/socrbase
It is loaded by default by /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist.
If you run
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
$ git remote rm origin | |
$ git remote add origin git@github.com:aplikacjainfo/proj1.git | |
$ git config master.remote origin | |
$ git config master.merge refs/heads/master |
set :user, 'username' | |
set :gateway, 'example.com' | |
set :ssh_options, { | |
user: fetch(:user), | |
forward_agent: false, | |
proxy: Net::SSH::Proxy::Command.new( | |
"ssh -l #{fetch(:user)} #{fetch(:gateway)} -W %h:%p" | |
) | |
} |
# Clear existing task so we can replace it rather than "add" to it. | |
Rake::Task["deploy:compile_assets"].clear | |
desc "Precompile assets locally and then rsync to web servers" | |
task :compile_assets do | |
on roles(:web) do | |
rsync_host = host.to_s | |
run_locally do | |
with rails_env: :production do ## Set your env accordingly. |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
require 'nokogiri' | |
require 'open-uri' | |
# Get a Nokogiri::HTML:Document for the page we're interested in... | |
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')) | |
# Do funky things with it using Nokogiri::XML::Node methods... | |
#### |
# Speed things up by not loading Rails env | |
config.assets.initialize_on_precompile = false |