Skip to content

Instantly share code, notes, and snippets.

@webparadoxer
webparadoxer / app.js
Created November 16, 2023 07:08 — forked from prof3ssorSt3v3/app.js
PWA 6 - Handling Install Events
const APP = {
deferredInstall: null,
init() {
if ('serviceWorker' in navigator) {
//register our service worker
navigator.serviceWorker
.register('/sw.js', {
updateViaCache: 'none',
scope: '/',
})
Полезные ключи программы psql
-U - Указываем пользователя, например postgres
-W - Приглашение на ввод пароля
-d название_БД - Подключение к БД название_БД
-h имя_хоста - Подключение к хосту имя_хоста
-p порт - По какому порту постгря ожидает подключения
-c команда - Выполнение команды SQL без выхода в интерактивный режим
-f file.sql - Выполнение команд из файла file.sql
-S - Однострочный режим, то есть, переход на новую строку будет выполнять запрос (избавляет от ; в конце конструкции SQL)
@webparadoxer
webparadoxer / country_state.json
Created February 18, 2023 19:39 — forked from manishtiwari25/country_state.json
List Of Countries With States And Other Useful Information, Updated On 02/01/2023 00:00:07
[
{
"name": "Andorra",
"countryCode": "AD",
"countryCodeAlpha3": "AND",
"phone": "376",
"currency": "EUR",
"stateProvinces": [
{
"name": "Sant Julià de Loria"
@webparadoxer
webparadoxer / git-cheat-sheet.txt
Created January 12, 2022 13:54 — forked from aktuba/git-cheat-sheet.txt
GIT cheat sheet
Git
================================================================================
Ссылки
------
* Книга "Git Community Book"
http://book.git-scm.com/
* Книга "Git Magic"
http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html
* Сравнение команд Git-SVN
@webparadoxer
webparadoxer / 1_Laravel_state-machine.md
Created March 15, 2018 21:17 — forked from iben12/1_Laravel_state-machine.md
Laravel: State-machine on Eloquent Model

Implementing State Machine On Eloquent Model*

* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.

Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.

Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.

That's the theory, let's get to the work.

@webparadoxer
webparadoxer / bootstrap
Last active August 29, 2015 14:24 — forked from zinovyev/bootstrap
#!/usr/bin/env bash
#
# Vagrant nginx & php-fpm
# Vagrant basic bootstrap.sh file configuration for getting a ready to use dev solution
#
# Ivan Zinovyev <vanyazin@gmail.com>
#
# (The "ubuntu/trusty64" box was used and tested)
#