feat (new feature)
fix (bug fix)
docs (changes to documentation)
style (formatting, missing semi colons, etc; no code change)
refactor (refactoring production code)
test (adding missing tests, refactoring tests; no production code change)
chore (updating grunt tasks etc; no production code change)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage[dvipsnames]{xcolor} % https://en.wikibooks.org/wiki/LaTeX/Colors | |
\definecolor{LightGray}{rgb}{0.97,0.97,0.97} | |
\usepackage{listings} % syntax highlighting | |
\lstdefinelanguage{SPARQL}{ | |
basicstyle=\small\ttfamily, | |
backgroundcolor=\color{LightGray}, | |
columns=fullflexible, | |
breaklines=false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Quick and dirty config hack for mkdocs pages. | |
# | |
# Created by Viliam Simko (viliam.simko@gmail.com) | |
# License: MIT | |
# | |
# Generates `pages:` section within `mkdocs.yml` file. | |
# The sections are ordered by filenames, however the section | |
# titles are taken either from the first H1 within a document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloQueryResult, QueryOptions, QueryResult, TypedDocumentNode, useApolloClient, useQuery } from "@apollo/client"; | |
import uuid from "uuid/v5"; | |
const uuidNamespace = uuid("suspense.queries.utils", uuid.DNS); | |
const suspenseQueryStore: Record<string, { read: () => ApolloQueryResult<unknown> }> = {}; | |
type SuspendQueryResult<Q, V> = Pick<QueryResult<Q, V>, "networkStatus" | "variables"> & { data: Q }; | |
/** Works with `TypedDocumentNode` which can be generated using `typed-document-node` codegen plugin. */ | |
export function useSuspenseQuery<Q, V>( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.fs.RemoteIterator | |
/** | |
* Converts RemoteIterator from Hadoop to Scala Iterator that provides all the familiar functions such as map, | |
* filter, foreach, etc. | |
* | |
* @param underlying The RemoteIterator that needs to be wrapped | |
* @tparam T Items inside the iterator | |
* @return Standard Scala Iterator | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://2ality.com/2019/10/eval-via-import.html | |
function esm(templateStrings, ...substitutions) { | |
let js = templateStrings.raw[0]; | |
for (let i=0; i<substitutions.length; i++) { | |
js += substitutions[i] + templateStrings.raw[i+1]; | |
} | |
return 'data:text/javascript;base64,' + btoa(js); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Viliam Simko | |
// using the example from https://github.com/Sneko/node-openalpr.git | |
const openalpr = require("node-openalpr") | |
const fs = require('fs') | |
async function identify(path) { | |
return new Promise((resolve, reject) => { | |
openalpr.IdentifyLicense(path, (error, output) => | |
error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run this code in dev console when you selected your icon | |
var x = document.createElement('img') | |
x.src = document.querySelector('.iconPreview').style.backgroundImage.replace(/url\("/,'').replace(/"\)$/, '') | |
document.body.replaceWith(x) | |
// or use this as a bookmark in your chrome | |
// Name: TNP Download | |
// URL: javascript:!(function() { var x = document.createElement('img'); x.src = document.querySelector('.iconPreview').style.backgroundImage.replace(/url\("/,'').replace(/"\)$/, ''); document.body.replaceWith(x) })() |
The easiest way to create a microservice
mkdir micro-demo
cd micro-demo
yarn add micro
echo 'module.exports = () => "Welcome to Micro"' > index.js
yarn micro
Now browse to http://localhost:3000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet"> | |
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"> | |
<script src="https://unpkg.com/vue/dist/vue.js"></script> | |
<script src="https://unpkg.com/vuetify/dist/vuetify.js"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<div id="app"> | |
<input v-model="myinput"> | |
<v-app> | |
<v-toolbar dense dark color="blue darken-2"> |
NewerOlder