Skip to content

Instantly share code, notes, and snippets.

View Slauta's full-sized avatar
🎯
Focusing

Roman Slauta

🎯
Focusing
View GitHub Profile
@Slauta
Slauta / index.php
Created September 16, 2021 08:44
FizzBuzz примеры использования на PHP
<?php
$start = 1;
$end = 100;
for ($number = $start; $number < $end + 1; $number++) {;
echo (implode('', array_map(function ($str, $delimeter) use ($number) {
return !($number % $delimeter) ? $str : '';
}, ['fizz', 'buzz'], [3, 5])) ?: $number) . "\n";
}
@Slauta
Slauta / README.md
Created June 9, 2021 10:58
Vue History Mode routing Nginx config example

HTML5 History Mode

The default mode for Vue Router is hash mode. It uses a URL hash to simulate a full URL so that the page won’t be reloaded when the URL changes.

We can set Vue Router to history mode to get rid of the hash. It uses history.pushState API to let us navigate URLs without a page reload.

This configuration allows you to configure nginx to work with Router History on the server side.

@Slauta
Slauta / .gitlab-ci
Last active March 18, 2024 16:53
electron-updater from private repo gitlab.com
variables:
VERSION_ID: '1.0.$CI_PIPELINE_ID'
stages:
- build
build:
image: slauta93/electron-builder-win
stage: build
artifacts:
@kentcdodds
kentcdodds / get-watchers.js
Last active December 4, 2023 22:34
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));