Skip to content

Instantly share code, notes, and snippets.

View magr0s's full-sized avatar
🇺🇦
Working from home

Oleksandr magr0s

🇺🇦
Working from home
View GitHub Profile
@magr0s
magr0s / npm-version-cheatsheet.md
Created September 20, 2023 18:32 — forked from leonardokl/npm-version-cheatsheet.md
npm version cheatsheet

NPM VERSION

Bump a package version

major (Breaking Change)

# version 1.0.0
$ npm version major # 2.0.0
$ npm version premajor # 2.0.0-0
@magr0s
magr0s / Javascript ISO country code to country name conversion
Created May 10, 2020 21:16 — forked from maephisto/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
@magr0s
magr0s / axios-catch-error.js
Created February 23, 2020 10:20 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@magr0s
magr0s / labels.json
Last active December 15, 2019 11:55
shopper-web-translate
{
"ok": "Ok"
}
@magr0s
magr0s / .travis.yml
Created December 10, 2019 06:12 — forked from kaiyuan01/.travis.yml
Travis CI Cordova Android build
language: android
node_js:
- 5.5
notifications:
email: false
sudo: false
@magr0s
magr0s / cloudSettings
Last active February 19, 2021 20:40
My VSCode settings
{"lastUpload":"2021-02-19T20:40:52.036Z","extensionVersion":"v3.4.3"}
export default {
// ...
scopedSlots: {
'body': (props) => { // <--
const { row, cols } = props // <--
const { answers } = row
const topAnswer = answers.reduce((prev, curr) => (prev.vote > curr.vote) ? prev : curr)
return answers.map((answer, i) => (
@magr0s
magr0s / table-actions.js
Created September 19, 2019 08:38
table-actions.js
'body-cell-actions': (props) => {
const {
col: { style },
row
} = props
return h('QTd', {
style,
scopedSlots: {
@magr0s
magr0s / Asset.php
Last active June 6, 2019 17:27
code-example
<?php namespace magr0s\ReportGenerator\Models;
/*
* Asset Model
*/
use Model;
class Asset extends Model
{
@magr0s
magr0s / .htaccess
Last active April 3, 2018 14:09
base .htaccess
RewriteEngine On
RewriteBase /
# Site page redirects
#RewriteCond %{REQUEST_URI} ^<old_page>$
#RewriteRule ^.*$ https://<site_domain>/<new_page>? [R=301,L]
#
# Remove slash after (php|html)
RewriteRule ^(.*).(php|html?)/ https://<site_domain>/$1.html [R=301,L]