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
name: Ruby Gem | |
on: | |
push: | |
branches: [ master ] | |
env: | |
gem_version: "1.1.1000" | |
jobs: |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: GraphQL Example Stack | |
Resources: | |
DeploymentMarkerTagIAPO39: | |
Type: AWS::CloudFormation::WaitConditionHandle | |
Graphql: | |
DependsOn: DeploymentMarkerTagIAPO39 | |
Properties: | |
AuthenticationType: API_KEY | |
LogConfig: |
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
# system upgrade | |
sudo apt update | |
sudo apt dist-upgrade | |
# visual code | |
sudo apt update | |
sudo apt install software-properties-common apt-transport-https wget | |
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | |
sudo apt update |
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
#go to hb_hba.conf | |
local all postgres ident | |
#go to psql | |
sudo -u postgres psql | |
#enter the following command to set or change the password | |
ALTER USER postgres PASSWORD 'actual_password'; | |
#go to hb_hba.conf to change this line back |
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
import telebot | |
import requests | |
from telebot import types | |
token = '' | |
bot = telebot.TeleBot(token) # type: TeleBot | |
@bot.message_handler(commands=['start']) | |
def start(m): | |
keyboard = types.InlineKeyboardMarkup() |
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
client = Aws::DynamoDB::Client.new( | |
region: Rails.application.secrets.dynamo_region, | |
credentials: Aws::Credentials.new(key,secret) | |
) | |
params = { | |
table_name: 'table_name', | |
key:{ | |
'id': self.object_id |
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
S3 Bucket Policy | |
{ | |
"Id": "Policy1", | |
"Statement": [ | |
{ | |
"Sid": "Stmt", | |
"Action": [ | |
"s3:ListBucket" | |
], |
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
require 'puma_worker_killer' | |
#require 'fileutils' | |
rails_env = ENV['RAILS_ENV'] || 'development' | |
app_dir = Dir.pwd | |
environment rails_env | |
case rails_env | |
when 'development' |
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
================================================================================================================== | |
IAM -> Roles -> Create new role->lambda-s3-execution-role->AWS Service Roles->AWS Lambda->AWSLambdaExecute | |
and save arn | |
================================================================================================================== | |
================================================================================================================== | |
aws configure | |
================================================================================================================== | |
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
# Задание 1. Hash | |
# Есть массив [2,1,2,3,3,4,1], нужно из массива сделать хэш, | |
# у которого будет key будет значение масива, а value кол-во повторяющихся элементов return {1=>2, 2=>2,3=>2,4=>1}. Выполнить 1 строкой | |
# Задание 2. File | |
# Необходимо получить картинку по url и сохранить ее в папку проекта/скрипта, одной строчкой. | |
# пример url = 'http://img0.joyreactor.cc/pics/post/full/%D0%BA%D0%BE%D1%82%D1%8D-%D0%9A%D0%BB%D0%B8%D0%BA%D0%B0%D0%B1%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE-%D0%BE%D0%B1%D0%BE%D0%B8-%D0%BA%D1%80%D0%B0%D1%81%D0%B8%D0%B2%D1%8B%D0%B5-%D0%BA%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D0%BA%D0%B8-2629498.jpeg' | |
# Задание 3. Работа с орм(activerecord) | |
# Существует таблица Users с атрибутами(email, password, nick_name) получить всех юзеров у который email not null и начинается с символа 'a' |
NewerOlder