Skip to content

Instantly share code, notes, and snippets.

# Boxstarter Script (Windows 10 settings and modern web deployment)
# Credit to github.com/elithrar
# Pre
Disable-UAC
# Set PC name
$computername = "JASM-PC"
if ($env:computername -ne $computername) {
Rename-Computer -NewName $computername
@zmts
zmts / aboutNodeJsArchitecture.md
Last active March 9, 2024 20:33
A little bit about Node.js API Architecture

A little bit about Node.js API Architecture (Архитектура/паттерны организации кода Node.js приложений)

node.js

TL;DR

code: https://github.com/zmts/supra-api-nodejs

Предисловие

Одной из болезней Node.js комьюнити это отсутствие каких либо крупных фреймворков, действительно крупных уровня Symphony/Django/RoR/Spring. Что является причиной все ещё достаточно юного возраста данной технологии. И каждый кузнец кует как умеет ну или как в интернетах посоветовали. Собственно это моя попытка выковать некий свой подход к построению Node.js приложений.

anonymous
anonymous / xywaceruzaluf.md
Created July 10, 2017 17:19
drupal создание шаблона с нуля

10 ноября состоялся очередной вебинар из серии "Друпал для всех", на этот. процесса создания темы для Drupal'а на основе сверстанного шаблона.. Курс "Создание сайтов с нуля при помощи системы управления Drupal". Стоит ли использовать готовые темы WordPress при создании сайта. тему с нуля; Создать тему на основе стартового шаблона _S.. Создать сайт на WordPress Создать сайт на Joomla Создать сайт на Drupal. Создание шаблонов, модулей и темизация Drupal.. всё с нуля) была создана вторая ветка этого великолепного модуля - Cache Expiration 7.x-2.x. 25 min. ... основу для своих дальнейших работ либо создать с нуля свою собственную.. Основная подсказка по созданию своей те

@zmts
zmts / tokens.md
Last active April 23, 2024 09:58
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@artanikin
artanikin / bootstrap_pagination_helper.rb
Created October 21, 2016 19:05
Will_paginate bootstrap 4 renderer
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
if page == current_page
link(page, "#", :class => 'active')
else
link(page, page, :rel => rel_value(page))
end
@subfuzion
subfuzion / global-gitignore.md
Last active April 23, 2024 22:47
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@quawn
quawn / getWorkingDays.php
Last active October 11, 2023 17:04
PHP: GetWorkingDays excluding weekend and holidays
<?php
function getWorkingDays($startDate,$endDate,$holidays) {
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;