Skip to content

Instantly share code, notes, and snippets.

View wir's full-sized avatar
🏠
Working from home

Sasha Beg wir

🏠
Working from home
  • Croatia Osiguranje
  • Croatia
View GitHub Profile
@wir
wir / country-bounding-boxes.py
Created September 15, 2021 14:55 — forked from graydon/country-bounding-boxes.py
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@wir
wir / Hooks.js
Created June 4, 2021 12:08 — forked from rheinardkorf/Hooks.js
Simple WordPress like hooks system for JavaScript.
/**
* @file A WordPress-like hook system for JavaScript.
*
* This file demonstrates a simple hook system for JavaScript based on the hook
* system in WordPress. The purpose of this is to make your code extensible and
* allowing other developers to hook into your code with their own callbacks.
*
* There are other ways to do this, but this will feel right at home for
* WordPress developers.
*
@wir
wir / customize-scrollbar.css
Created April 29, 2021 16:41 — forked from spemer/customize-scrollbar.css
Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@wir
wir / perf-diagnostics.css
Created April 20, 2021 13:11 — forked from tkadlec/perf-diagnostics.css
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@wir
wir / solution.md
Created January 12, 2021 08:16 — forked from lgg/solution.md
JetBrains intellij idea + NVM + nodejs + WebStorm

NVM + WebStorm

If you get error:

run npm command gives error "/usr/bin/env: node: No such file or directory

in file watcher

@wir
wir / .htaccess
Created December 19, 2020 09:07 — forked from lynt-smitka/.htaccess
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@wir
wir / Accessibility Panel - JS Controls
Created October 23, 2020 12:06 — forked from DougCrossDesign/Accessibility Panel - JS Controls
Accessibility Panel - JS Controls
Accessibility Panel - JS Controls
---------------------------------
Converted Wordpress Plugin Example of an Accessibility Panel made with Javascript to control visual design of a HTML / CSS for users with visual disabilities to explore the content. This example is scalable for any layout based on which targets are bing using for the containers, text and link variables.
A [Pen](https://codepen.io/DougCrossDesign/pen/RjyaYZ) by [Doug Cross](https://codepen.io/DougCrossDesign) on [CodePen](https://codepen.io).
[License](https://codepen.io/DougCrossDesign/pen/RjyaYZ/license).
@wir
wir / resize.js
Created October 23, 2020 12:03 — forked from brandonrunyon/resize.js
accessibility feature: enlarge text
function resize(ele, size, classname){
var elem = document.getElementsByTagName(ele);
for (var i=0; i<elem.length; i++)
{
if (elem[i].className==classname) {
elem[i].style.fontSize=size;
}
}
}
untrailingSlashIt(str) {
return str.replace(/\/$/, '');
}
trailingSlashIt(str) {
return untrailingSlashIt(str) + '/';
}
@wir
wir / wp-top-parent-body-class.php
Created September 13, 2020 16:38 — forked from hearvox/wp-top-parent-body-class.php
Add class name for top-level parent category or page to body tag in WordPress posts, pages, and archives.
<?php
/* Add body-class for top-level parent Page or Category */
function topcatpg_body_class( $class ) {
$prefix = 'topic-'; // Editable class name prefix.
$top_cat_pg = 'home'; // Default.
global $top_cat_pg;
// Get class name from top-level Category or Page.
global $wp_query;
if ( is_single() ) {