Skip to content

Instantly share code, notes, and snippets.

View junkycoder's full-sized avatar

Dan Hromada junkycoder

  • Česká republika
View GitHub Profile
@junkycoder
junkycoder / vscode-react-patch.js
Last active September 9, 2018 11:19
Patch the `reactClassComponentPropTypes` snippet to define `propTypes` as static class property
#!/usr/bin/env node
/**
* Node.js script as patch method for vscode-react extension of 2.2.0 version.
*
* https://github.com/xabikos/vscode-react
* https://github.com/tc39/proposal-class-public-fields
*/
const fs = require('fs');
@junkycoder
junkycoder / Application.js
Last active November 13, 2018 09:47
Simple React Native auth factory
/**
* Usage in React Native component example
*/
import React, { Component } from 'react';
import { NavigationActions } from 'react-navigation';
import Navigator from 'app/navigators/RootNavigator';
import createAuth from './library/auth';
export default class Application extends Component {
navigator = null;
@junkycoder
junkycoder / script.js
Created April 28, 2020 08:43
PayToGo Bookmark
window.open('https://app.paytogo.cz/podnik/cisterna', 'PayToGo', 'toolbar=no, menubar=no, width=420, height=600')
@junkycoder
junkycoder / fix-stencil-ts.txt
Last active June 5, 2020 05:43
Fix npm start of Stencil (TypeScript issues)
$ rm ./node_modules/typescript/lib/lib.es2015.iterable.d.ts
$ touch ./node_modules/typescript/lib/lib.es2015.iterable.d.ts
$ rm ./node_modules/typescript/lib/lib.es2015.generator.d.ts
$ touch ./node_modules/typescript/lib/lib.es2015.generator.d.ts
$ npm start
@junkycoder
junkycoder / download-inline-svg-images.js
Created April 27, 2021 13:34
Download all svg icons on page
function download(filename, text, mime = 'image/svg+xml', ext = 'svg') {
var element = document.createElement('a');
element.setAttribute('href', `data:${mime};charset=utf-8, ${encodeURIComponent(text)}`);
element.setAttribute('download', `${filename}.${ext}`);
element.style.display = 'none';
document.body.appendChild(element);
element.click();