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
# Read the http_accept_language setup from browser request | |
# | |
set $first_language $http_accept_language; | |
if ($http_accept_language ~* '^(.+?),') { | |
set $first_language $1; | |
} | |
# Set the lang directory for the static cached pages | |
# | |
set $language_suffix 'en'; |
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
# Minify the HTML | |
# | |
/home/vutuv/.npm-global/bin/html-minifier --case-sensitive --collapse-boolean- | |
attributes --collapse-whitespace --remove-comments --remove-optional-tags --remo | |
ve-tag-whitespace --sort-attributes --sort-class-name --collapse-inline-tag-whit | |
espace --conservative-collapse de/index.html > de/compressed.html | |
/home/vutuv/.npm-global/bin/html-minifier --case-sensitive --collapse-boolean- | |
attributes --collapse-whitespace --remove-comments --remove-optional-tags --remo | |
ve-tag-whitespace --sort-attributes --sort-class-name --collapse-inline-tag-whit | |
espace --conservative-collapse en/index.html > en/compressed.html |
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
if (params.butteraugli_target > 2.0f) { | |
fprintf(stderr, | |
"Guetzli should be called with quality >= 84, otherwise the\n" | |
"output will have noticeable artifacts. If you want to\n" | |
"proceed anyway, please edit the source code.\n"); | |
return false; | |
} |
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
guetzli -quality 75 avatar.jpg /tmp/q75-avatar.jpg | |
convert avatar.jpg /tmp/q75-avatar.jpg -fx 'hypot(65-i, 65-j) < 65 ? u : v' new_avatar.jpg | |
rm /tmp/q75-avatar.jpg |
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
# /etc/cron.d/certbot: crontab entries for the certbot package | |
# | |
# Upstream recommends attempting renewal twice a day | |
# | |
# Eventually, this will be an opportunity to validate certificates | |
# haven't been revoked, etc. Renewal will only occur if expiration | |
# is within 30 days. | |
SHELL=/bin/sh | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
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
mix phoenix.new blog | |
cd blog | |
vim config/dev.exs | |
brew install postgres | |
brew services start postgres | |
createuser -W --createdb blog | |
>> demo | |
mix ecto.create | |
mix phoenix.gen.html Post posts subject body | |
vim web/router.ex |
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
$ rails new hello-world-action-cable | |
[...] | |
$ cd hello-world-action-cable | |
$ rails generate controller page index | |
[...] |
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
Rails.application.routes.draw do | |
get ‘page/index’ | |
root ‘page#index’ | |
end |
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
<h1>Action Cable Example</h1> | |
<div id=”messages”></div> |
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
gem ‘jquery-rails’ |
OlderNewer