Skip to content

Instantly share code, notes, and snippets.

View kiote's full-sized avatar
👋

Ёkaterina Krivich kiote

👋
View GitHub Profile
...
env-vars:
- name: PG_USERNAME
valueFrom:
secretKeyRef:
key: username
- name: PG_USERNAME
valueFrom:
secretKeyRef:
key: username

How to write readmes for your projects

"Your" project is a project you happen to make any changes at. Any Readme can contain also extra parts, specific for a project.

Necessary parts

Underneath is a template you can use in a project without any (or with scaffolded) readme:

Intro

@kiote
kiote / fp_vs_oop.js
Last active February 6, 2021 14:50
stateless vs stateful example
// stateful vs stateless
let x = 1;
const stateful = () => x = x + 1;
stateful(); // x = 2
stateful(); // x = 3
const stateless = (x) => x + 1;
stateless(x); // x = 4
stateless(x); // x = 4
 docker build -t run-testing20 .
 docker run -it --entrypoint /bin/sh run-testing20:latest

Tasks

Two sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

Example:
@kiote
kiote / ra-commands.md
Last active August 21, 2018 10:57
rasbery pi commands

Play sound

aplay test.wav

Record sound

arecord -D plughw:1,0 -d 3 test.wav

Rotate screen

irb(main):001:0> def a(b = {})
irb(main):002:1> puts b[:one]
irb(main):003:1> end
=> :a
irb(main):004:0> a
=> nil
irb(main):005:0> a(nil)
NoMethodError: undefined method `[]' for nil:NilClass
from (irb):2:in `a'
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'headless'
RSpec.configure do |config|
headless = Headless.new
require 'rails_helper'
describe Rack::Attack, :integration do
include Rack::Test::Methods
after(:each) do
Rack::Attack.cache.store.clear
end
context 'admin logins' do
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from cities.models import Country
def add_country_connection(apps, schema_editor):
ExtraCountry = apps.get_model("extra_countries", "ExtraCountry")
for country in Country.objects.all():