Skip to content

Instantly share code, notes, and snippets.

View sygn's full-sized avatar

Željko Tadić sygn

  • Zagreb, Croatia
View GitHub Profile
@sygn
sygn / eslint_prettier_airbnb.md
Created July 17, 2021 10:30 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@sygn
sygn / .yml
Created September 15, 2020 21:41 — forked from nishithMobinius/.yml
bitbukcet-pipelines
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
branches:
test: #name of your test branch
@sygn
sygn / yup-async.js
Created May 11, 2020 21:46
async form validation
// email validation
// .test('checkDuplUsername', 'same name exists', function (value) {
// return new Promise((resolve, reject) => {
// kn.http({
// url: `/v1/api/${value}`,
// method: 'head',
// }).then(() => {
// // exists
// resolve(false)
@sygn
sygn / rename.ps
Created April 24, 2020 10:47
Rename multiple files - windows
get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace("Radiohead -", "") }
// source: https://superuser.com/a/578076
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@sygn
sygn / index.jsx
Created January 21, 2020 12:25
Debug re-render cause in React
componentDidUpdate(prevProps, prevState) {
Object.entries(this.props).forEach(([key, val]) =>
prevProps[key] !== val && console.log(`Prop '${key}' changed`)
);
if (this.state) {
Object.entries(this.state).forEach(([key, val]) =>
prevState[key] !== val && console.log(`State '${key}' changed`)
);
}
}
@sygn
sygn / fade-in.scss
Created January 8, 2020 14:57 — forked from sajhd/fade-in.scss
Fade In Animation Mixin
/* Fade In Animation */
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }
@sygn
sygn / index.js
Created October 24, 2019 21:31
View network requests in chrome developer tools for react-native
// To see all the requests in the chrome Dev tools in the network tab.
XMLHttpRequest = GLOBAL.originalXMLHttpRequest ?
GLOBAL.originalXMLHttpRequest :
GLOBAL.XMLHttpRequest;
### Keybase proof
I hereby claim:
* I am sygn on github.
* I am ztadic91 (https://keybase.io/ztadic91) on keybase.
* I have a public key ASD0Wy_GZx1WjTmx23vkRwKNBT48DBAMOZzwgtPXaS_5_Qo
To claim this, I am signing this object:
@sygn
sygn / laenderinfos.sql
Created November 23, 2017 20:29 — forked from fiee/laenderinfos.sql
table of information about all countries of the world (German names)
CREATE TABLE adressen.land
(
isocode_2 character(2) not null, -- ISO 3166 ALPHA-2
isocode_3 character(3) not null, -- ISO 3166 ALPHA-3
name character varying not null, -- deutscher Name des Landes (international besser via ISO-Code ankoppeln!) // German name of the country
vorwahl integer default null, -- internationale Vorwahl // international phone code
null_bei_vorwahl boolean default FALSE, -- muss man die Null der Ortsvorwahl auch nach der internationalen Vorwahl wählen? // must one dial zero between international and local phone code?
vorwahl_lokal boolean default FALSE, -- muss man vor Ort die Vorwahl wählen? // must one dial the local phone code also locally?
tld character varying default NULL, -- Top Level Domain
kfz character varying default NULL, -- KFZ-Kennzeichen // car code