Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
NightShift

Loreto Parisi loretoparisi

🐍
NightShift
View GitHub Profile
@loretoparisi
loretoparisi / wikidata_properties.sparql
Created April 1, 2022 08:30
Wikidata Entity Properties Sparql query
SELECT ?wdLabel ?ooLabel
WHERE {
VALUES (?s) {(wd:%@)}
?s ?wdt ?o .
?wd wikibase:directClaim ?wdt .
?wd rdfs:label ?wdLabel .
OPTIONAL {
?o rdfs:label ?oLabel .
FILTER (lang(?oLabel) = "en")
}
@loretoparisi
loretoparisi / wikidata_religions
Created March 30, 2022 13:43
Wikidata Query Religions
https://query.wikidata.org/#SELECT%20%3Fitem%20%3Ffreebase_id%20%3Fmodified%20%3Fen%20%3Furl_en%20%3Fes%20%3Furl_es%20%3Fit%20%3Furl_it%20%3Ffr%20%3Furl_fr%20%3Fde%20%3Furl_de%20%3Fpt%20%3Furl_pt%20%3Fko%20%3Furl_ko%20%3Fja%20%3Furl_ja%20%3Fzh%20%3Furl_zh%20%20WHERE%20%7B%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ9174.%20%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UNION%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ5390013.%20%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UNION%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ7257.%20%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UNION%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ71966963.%20%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20UNION%20%20%20%20%20%2
@loretoparisi
loretoparisi / ukraine.css
Created March 2, 2022 17:15
SVG Lighting Effects With The feDiffuseLighting Filter Primitive
/* Add the seed attribute and set it to a random integer in <feTurbulence> to create your own variant! */
html,
body,
object {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
}
div {
@loretoparisi
loretoparisi / resumablejs.html
Created January 31, 2022 14:22
ResumableJS File upload Example
<html>
<header>
<style>
.drop-zone {
text-align: center;
border: 2px dashed #ccc;
}
.danger,
.danger:hover {
@loretoparisi
loretoparisi / resumable.js
Last active January 31, 2022 16:21
Resumable.JS - NodeJS Express example - fixed deprecations, updated to latest express
var fs = require("fs"),
path = require("path"),
util = require("util"),
Stream = require("stream").Stream;
module.exports = resumable = function (temporaryFolder) {
var $ = this;
$.temporaryFolder = temporaryFolder;
$.maxFileSize = null;
$.fileParameterName = "file";
@loretoparisi
loretoparisi / targz.js
Created November 20, 2021 01:09
NodeJS Unarchive tar gz file
const { Duplex } = require('stream'); // Native Node Module
function bufferToStream(myBuffer) {
let tmp = new Duplex();
tmp.push(myBuffer);
tmp.push(null);
return tmp;
}
async function tarStream() {
const zlib = require('zlib');
@loretoparisi
loretoparisi / index.html
Created November 19, 2021 22:53 — forked from Lakerfield/index.html
Print ZPL from browser
<!DOCTYPE html>
<html>
<head>
<title>Print Inventory Labels at Papa's</title>
<style>
* {
box-sizing: border-box;
}
@loretoparisi
loretoparisi / List_of_Wikipedias.json
Created October 13, 2021 16:19
List of Wikipedias as JSON
[{
"language": "English",
"language_local": "English",
"wiki": "en",
"articles": "6,393,265",
"totals": "1,044,989,942",
"edits": "1,077",
"admins": "42,366,457",
"users": "125,915",
"active_users": "895,061"
@loretoparisi
loretoparisi / es_autocomplete.mapping.js
Created September 20, 2021 17:16
Elastic Search Auto Complete Analyzer
{
"aliases": {},
"mappings": {
"properties": {
"text": {
"type": "text",
"analyzer": "autocomplete"
}
}
},

With wildcard

{
  "query": {
    "bool": {
      "must": [
        {
          "wildcard": {
 "text": "*antonio*banderas*"