- 5$
- 1 CPU
- 512Mb memory
- 1T transfer
- 20GB SSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to install Sublime Text 2 on Ubuntu 12.04 (Unity) | |
April 28, 2012 by Jevin | 307 Comments | |
Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now. | |
I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post will show you how to integrate Sublime Text to Unity (which, I’m glad to report, has now matured into a fully functional user interface). | |
So let’s get on with this. Here is my how to install Sublime Text on Ubuntu tutorial. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Slug1 do | |
def slugify(input), do: map_slug(input, %{pattern: ~r/\s+/}) | |
def slugify2(input), do: map_slug(input, %{pattern: " "}) | |
defp map_slug(input, %{pattern: pattern}) do | |
input | |
|> to_string() | |
|> String.trim() | |
|> String.downcase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise 'Wrong Ruby version!' unless RUBY_VERSION >= '2.6.0' | |
module Strings | |
Trim = -> str { String(str).strip } | |
Replace = -> (sub, new_sub, str) { String(str).gsub(sub, new_sub) } | |
LowerCase = -> str { String(str).downcase } | |
end | |
# -- Alternative syntax -- | |
Slugify = # Slugify = |
The version of ImageMagick that is installed when you run apt-get install imagemagick
on Ubuntu 14.04 is older than I would like.
$ convert --version
Version: ImageMagick 6.7.7-10 2016-06-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module EscapeLike | |
# Escape SQL LIKE arguments. N.B. This should be combined with use of the | |
# ESCAPE parameter also. See: | |
# http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html | |
# | |
# pattern = escape_like(params[:pattern]) << '%' | |
# query = where(["name LIKE ? ESCAPE ?", pattern, '\\']) | |
# | |
# By default this method uses MySQLs default escape, backslash. | |
# Unfortunately, this can get exceedingly confusing in output. As soon as |
NewerOlder