Skip to content

Instantly share code, notes, and snippets.

View AlexanderMint's full-sized avatar
🏄‍♂️
Surfing

Alexander Mint AlexanderMint

🏄‍♂️
Surfing
View GitHub Profile
@maratori
maratori / .golangci.yml
Last active April 24, 2024 16:59
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.57.2
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@eusonlito
eusonlito / updated-at.sql
Last active April 21, 2024 21:47
Use trigger to change `updated_at` on all PostgreSQL tables
#
# Delete previous function definition (if exists)
#
DROP FUNCTION IF EXISTS before_update_updated_at() CASCADE;
#
# Create function to update updated_at timestamp if changed values on update
#
CREATE OR REPLACE FUNCTION before_update_updated_at() RETURNS trigger AS
$BODY$
@veox
veox / erc20.abi.json
Created January 21, 2018 14:59
ERC20 ABI in JSON format
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
@Jekins
Jekins / Markdown-docs.md
Last active April 29, 2024 14:55
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня
@rveitch
rveitch / sass-7-1-pattern.scss
Last active April 23, 2024 08:10
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@mandiwise
mandiwise / Update remote repo
Last active May 2, 2024 08:59
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@justingarrick
justingarrick / visitor.rb
Last active December 24, 2017 11:23
Visit a webpage X times with a random user-agent via a randomly chosen proxy server. A decent proxy list can be downloaded from http://www.proxynova.com/proxy_list.txt, but this is not scripted because the site frequently goes down.
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
class Visitor
def initialize(proxy_file, url, iterations)
@proxy_file = proxy_file
@url = url
@iterations = iterations
end
@timcheadle
timcheadle / README.md
Last active January 26, 2023 00:56
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.

@evtuhovich
evtuhovich / gist:1134998
Created August 9, 2011 19:43
Список вопросов для собеседования
Ruby
принципиальное различие скриптовых и “обычных” языков
3 принципа ООП
реализация множественного наследования в ruby
duck typing
многопоточность в ruby
Rails
что такое MVC и зачем это нужно
локига в контроллере, должна ли быть и почему
синхронные и асинхронные операции — предложить варианты решения