Пример выгрузки файлов на Яндекс.Диск из Bash через официальный REST API.
Тут все просто.
Пример выгрузки файлов на Яндекс.Диск из Bash через официальный REST API.
Тут все просто.
| <!-- | |
| Author: <Anthony Sychev> (hello at dm211 dot com | a.sychev at jfranc dot studio) | |
| Buy me a coffe: https://www.buymeacoffee.com/twooneone | |
| Untitled-1 (c) 2022 | |
| Created: 2022-01-25 20:06:02 | |
| Desc: Attach some dom element on the bottom of screen as absolute, triggered to move on resize address bar. | |
| --> | |
| <html> |
| # Based on https://steveholgado.com/nginx-for-nextjs/ | |
| # - /var/cache/nginx sets a directory to store the cached assets | |
| # - levels=1:2 sets up a two‑level directory hierarchy as file access speed can be reduced when too many files are in a single directory | |
| # - keys_zone=STATIC:10m defines a shared memory zone for cache keys named “STATIC” and with a size limit of 10MB (which should be more than enough unless you have thousands of files) | |
| # - inactive=7d is the time that items will remain cached without being accessed (7 days), after which they will be removed | |
| # - use_temp_path=off tells NGINX to write files directly to the cache directory and avoid unnecessary copying of data to a temporary storage area first | |
| proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off; | |
| upstream nextjs_upstream { |
| #! /bin/bash | |
| # I am exporting variables to have them in my shell after I ran the script. | |
| # I find that convenient. Of course, those can/should be removed in "serious" deployments. | |
| # create a time string between "1:00" and "5:59" | |
| export REBOOT_TIME=`perl -e "print scalar(int 1 + 5 * rand) . q[:] . scalar(int 6 * rand) . scalar(int 9 * rand)"` | |
| export HOSTNAME=`hostname` | |
| export NETWORK_DEVICE=eth0 # might be different in cloud servers |
| .counter | |
| .down{:onclick => "decreaseCount(event, this)"} - | |
| %input{:type => "text", :value => "1"} | |
| .up{:onclick => "increaseCount(event, this)"} + |
SSL setup: https://vimeo.com/209534466
rails g migration CreateJoinTableGameInvitesInvitees game_invites invitees
has_and_belongs_to_many :invitees, class_name: 'User', foreign_key: 'invitee_id', #the associated column and the alien model
join_table: 'game_invites_invitees', #name of the join table
association_foreign_key: 'game_invite_id' #the name of the domestic model in the join tableSSL setup: https://vimeo.com/209534466
rails g migration CreateJoinTableGameInvitesInvitees game_invites invitees
has_and_belongs_to_many :invitees, class_name: 'User', foreign_key: 'invitee_id', #the associated column and the alien model
join_table: 'game_invites_invitees', #name of the join table
association_foreign_key: 'game_invite_id' #the name of the domestic model in the join table| #!/usr/bin/env elixir | |
| defmodule Canvas do | |
| @behaviour :wx_object | |
| @title "Canvas Example" | |
| @size {600, 600} | |
| def start_link() do | |
| :wx_object.start_link(__MODULE__, [], []) |
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |