Skip to content

Instantly share code, notes, and snippets.

Avatar

Marko Zabreznik MarZab

View GitHub Profile
@MarZab
MarZab / .eslintignore
Created Jul 14, 2020
Working Serverless Typescript Example
View .eslintignore
node_modules
.serverless
.vscode
*.config.js
_warmup
**/*.js
View hitrinakup-notifier.user.js
// ==UserScript==
// @name Hitri Nakup Notifier
// @version 0.1
// @description Doubleclick on date to start (the button will get a pulsing effect ans start clicking when done)
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @match https://hitrinakup.com/*
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle(`
@MarZab
MarZab / update-dist.js
Created Aug 21, 2018
WebExtensions (web-ext) update manifest for self-hosted updates
View update-dist.js
/**
* Create updates.json for offline automatic updates
* https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Updates
*
* Usage:
* node update-dist.js [path to .xpi files] [path to update.json] [url prefix to .xpi files]
*
* Author:
* marko@zabreznik.net
*/
@MarZab
MarZab / Multiselect.vue
Last active Mar 7, 2020
vue-multiselect inside bootstrap-vue; demo: https://codesandbox.io/s/0x608nxo10
View Multiselect.vue
<template>
<div
:tabindex="searchable ? -1 : tabindex"
:class="[isOpen?'active':'', disabled?'disabled':'', size && size !== 'default'? 'multiselect-'+size : '' ]"
@focus="activate()"
@keydown.self.down.prevent="pointerForward()"
@keydown.self.up.prevent="pointerBackward()"
@keydown.enter.tab.stop.self="addPointerElement($event)"
@keyup.esc="deactivate()"
class="multiselect">
@MarZab
MarZab / edavki_ekartica_malenkost_boljsi_izvoz.user.js
Last active Jul 28, 2020
eDavki eKartica - Malenkost boljši izvoz
View edavki_ekartica_malenkost_boljsi_izvoz.user.js
// ==UserScript==
// @name eDavki eKartica - Malenkost boljši izvoz
// @version 1.4
// @description Na eKartici portala eDavki doda nov gumb, "Alt. CSV", ki vrne UTF-8 CSV datoteko v standardni obliki datuma. Uporaba na lastno odgovornost.
// @author Marko Zabreznik
// @match https://edavki.durs.si/EdavkiPortal/[*]/PersonalPortal/CommonPages/Documents/eKartica.aspx?RepresentedTaxPayerProfileId=*&form=eKartica
// @grant none
// ==/UserScript==
(function() {
@MarZab
MarZab / __init__.py
Created Jul 2, 2015
Ajenti Widget Arbitrary Shell Command Output
View __init__.py
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Shiget',
icon='cog',
dependencies=[
PluginDependency('main'),
PluginDependency('dashboard'),
],
@MarZab
MarZab / Vagrantfile
Created Jun 25, 2015
Ajenti Demo Vagrantfile
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = "debian/jessie64"
config.vm.hostname = "ajenti-dev"
config.vm.network "private_network", ip: "192.168.150.170"
config.vm.network "forwarded_port", guest: 8000, host: 8000
@MarZab
MarZab / leaflet-custom-map.html
Last active Apr 11, 2020
Leaflet with latlng scale in meters and Control.Scale to match
View leaflet-custom-map.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Custom Simple Map Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<link rel="stylesheet" href="https://cdn.rawgit.com/ardhi/Leaflet.MousePosition/master/src/L.Control.MousePosition.css">
@MarZab
MarZab / ngrams.js
Created Apr 13, 2015
JavaScript Implementation of N-Gram Text Categorisation based on paper by William B. Cavnar and John M. Trenkle
View ngrams.js
'use strict';
/*
N-Gram-Based Text Categorisation
Implementation by marko@zabreznik.net
28.3.2015 All rights reserved.
Based on the paper by:
William B. Cavnar and John M. Trenkle
Environmental Research Institute of Michigan
@MarZab
MarZab / gist:fff319b893d3209c7eba
Created Mar 27, 2015
Statistics of WordPress locale usage per capita (native speakers); data from translate.wordpress.org and WikiPedia
View gist:fff319b893d3209c7eba
Locale Release Pack Total Native speak. Total per NS
en 17037257 — 17037257 360 0.04732571389
nb_NO 55975 101078 157053 5 0.03141060000
nl_NL 444729 44564 489293 22 0.02224059091
sv_SE 151115 9325 160440 9.2 0.01743913043
fr_FR 1038957 237164 1276121 75 0.01701494667
de_DE 1080555 415812 1496367 89 0.01681311236
sk_SK 25968 52657 78625 5.2 0.01512019231
fa_IR 829918 55124 885042 60 0.01475070000
sl_SI 13247 22763 36010 2.5 0.01440400000
You can’t perform that action at this time.