Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:
Permalink: git.io/vps
| Provider | Type | RAM | Cores | Storage | Transfer | Network | Price |
|---|
| # THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
| # PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
| # | |
| # | |
| # Libraries and infrastructure | |
| sudo apt update -y | |
| sudo apt install -y \ | |
| docker.io docker-buildx \ | |
| build-essential pkg-config autoconf bison rustc cargo clang \ |
Permalink: git.io/vps
| Provider | Type | RAM | Cores | Storage | Transfer | Network | Price |
|---|
| #!/usr/bin/env ruby | |
| require 'selenium-webdriver' | |
| wd = Selenium::WebDriver.for :remote, url: 'http://10.3.1.7:4444/wd/hub', desired_capabilities: :chrome | |
| wd.navigate.to 'https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/' | |
| # Get the actual page dimensions using javascript | |
| # | |
| width = wd.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);") |
| require 'benchmark' | |
| require 'benchmark/ips' | |
| Benchmark.ips do |r| | |
| r.report("group_by") do | |
| (0..1000).group_by { |w| w % 2 == 0 }.values | |
| end | |
| EVEN = 0 | |
| ODD = 1 |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| namespace :deploy do | |
| task :setup_solr_data_dir do | |
| run "mkdir -p #{shared_path}/solr/data" | |
| end | |
| end | |
| namespace :solr do | |
| desc "start solr" | |
| task :start, :roles => :app, :except => { :no_release => true } do | |
| run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec sunspot-solr start --port=8983 --data-directory=#{shared_path}/solr/data --pid-dir=#{shared_path}/pids" |
Указываем свое имя и почту
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Делаем алиасы на команды
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh