Skip to content

Instantly share code, notes, and snippets.

View welblaud's full-sized avatar
🤔
solving something again

Honza Hejzl welblaud

🤔
solving something again
  • Husinec-Řež (Czech Republic)
View GitHub Profile
@Softwave
Softwave / README.md
Last active November 14, 2024 11:39
Fibonacci Program

Fib

Simple fibonacci number calculator.

Usage: fib nth Fibonacci number

@erickpatrick
erickpatrick / init.vim
Last active September 10, 2024 15:30
Neovim CoC Intelephense configuration
" TODO: split up config into multiple files
" source $HOME/.config/nvim/vim-plug/plugins.vim
" source $HOME/.config/nvim/<category>/<sub-category-filename>.vim
" source $HOME/.config/nvim/<plug-config>/<plugin-name>.vim
set nocompatible
filetype off
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
@welblaud
welblaud / imageValidator.js
Last active July 30, 2020 14:03
Quick Image Validator for checking the quality of images
// imageValidator.js
'use-strict';
function handleFileSelect(evt) {
let files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (let i = 0; i < files.length; i++) {
@welblaud
welblaud / newBot.js
Last active February 6, 2019 08:59
App for trading on gate.io forex market
// newBot.js
/* ##################### MODULES ####################### */
let fetch = require( 'node-fetch' );
let fs = require( 'fs' );
let crypto = require( 'crypto' );
let querystring = require( 'querystring' );
/* ##################### CONSTANTS ####################### */
const KEY = '';
@joewiz
joewiz / raising-whitespace-consciousness.md
Last active October 2, 2017 08:45
Notes on factors that influence whitespace in XQuery, with a focus on eXist 3.x

Notes in preparation for a blog post or article.

Factors

  • Whitespace in the original document
    • As entered, or introduced/manipulated by an editor's functions, such as oXygen's "Format and indent" (and settings thereof), or features, such as Atom's default behavior of trimming trailing whitespace
  • How the document is exposed to the XQuery processor
    • Fetched (get) via a query from the network (doc(), hc:send-request()) or file system (file:read(), xmldb:store-files-from-pattern())
    • Uploaded (put) to the database and stored via REST, WebDAV, XML-RPC
    • Included inline in a query, as an in-memory node; whitespace in in-memory nodes is affected by boundary-space strip|preserve (default is strip)
@jbkopecky
jbkopecky / seoul256.vim
Created November 10, 2016 13:27
Seoul256 own custom vim Airline theme (vim/autoload/airline/themes/seoul256.vim)
let g:airline#themes#seoul256#palette = {}
function! airline#themes#seoul256#refresh()
let M0 = airline#themes#get_highlight('Special')
let accents_group = airline#themes#get_highlight('Special')
let modified_group = [M0[0], '', M0[2], '', '']
let warning_group = airline#themes#get_highlight2(['airline_warning', 'bg'], ['airline_warning', 'fg'])
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLine', 'fg'])
@solancer
solancer / mod_pagespeed .htaccess
Last active January 11, 2023 07:25
mod_pagespeed .htaccess configuration
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@welblaud
welblaud / dtp-utils.xqm
Last active October 14, 2022 06:18
A module for preparing TEI Simple XML files stored in eXist-db for latter usage in InDesign
xquery version "3.0";
module namespace dtp-utils = 'http://46.28.111.241:8081/exist/db/apps/karolinum-x/modules/dtp-utils';
import module namespace cust-utils = 'http://46.28.111.241:8081/exist/db/apps/karolinum-x/modules/cust-utils' at 'cust-utils.xqm';
declare namespace tei = 'http://www.tei-c.org/ns/1.0';
(:~ This module is useful for in-memory converting of TEI Simpe XML into XML suitable
: for importing into InDesign. It is not a silver bullet, it was tested and developed
: for a very specific scenario. However, it should be useful for anyone who uses TEI
: Simple XML (possibly with minor modifications of replacing strings and so on) and
@joewiz
joewiz / strip-diacritics.xq
Last active October 22, 2022 14:42
Strip diacritics, with XQuery
xquery version "3.1";
declare function local:strip-diacritics($string as xs:string) as xs:string {
$string
=> normalize-unicode("NFD")
=> replace("\p{IsCombiningDiacriticalMarks}", "")
};
declare function local:inspect-diacritics($string as xs:string) as element() {
let $normalized := normalize-unicode($string, "NFD")
@tsbarnes
tsbarnes / gruvbox-dark.theme
Last active April 24, 2024 19:29
Gruvbox color scheme for XFCE4 terminal, place it in /usr/share/xfce4/terminal/colorschemes
[Scheme]
Name=Gruvbox (dark)
ColorForeground=#f2f2e5e5bcbc
ColorBackground=#323230302f2f
ColorCursor=#d65bc4cd8ca1
ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#f2f2e5e5bcbc;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#fffff1f1c6c6