Skip to content

Instantly share code, notes, and snippets.

View denpatin's full-sized avatar
🐷
己亥

Den Patin denpatin

🐷
己亥
View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
CREATE TABLE users (
user_id SERIAL,
user_name VARCHAR(80) NOT NULL,
user_email VARCHAR(80) UNIQUE,
password VARCHAR(80) NOT NULL,
registration_date TIMESTAMP,
PRIMARY KEY (user_id)
);
CREATE TYPE CATEGORY_TYPE AS ENUM ('income', 'spending');
@zmts
zmts / tokens.md
Last active May 4, 2024 17:22
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@pavelgordon
pavelgordon / ConfigParser.js
Created September 16, 2016 15:49
what the fuck
Ext.namespace('Custom.config');
/**
* The Configparser is responsible for:
*
* 1. loading the json-config-file into the application
* 2. parsing the json-file into a javascript object
* (while already transforming values for tileSize, extent and layer-attributes into
* their respective objects)
* 3. rendering the application:

New T-Library

Fixed bugs from old version

  • Теперь работает форма создания книги у администратора (раньше падала)
  • Поисковик в библиотеке работает
  • Когда администратору падает заявка от пользователя на взятие книги из библиотеки, администратор жмет кнопочку и сразу генерится письмо на адрес пользователя с заготовленным тексом "Добрый день! Заберите книгу в 7.3". Это вроде уже было, но видимо имелось в виду
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active April 2, 2024 14:57
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@axefrog
axefrog / 0.suffixtree.cs
Last active July 12, 2023 01:01
C# Suffix tree implementation based on Ukkonen's algorithm. Full explanation here: http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SuffixTreeAlgorithm
{
public class SuffixTree
{