Skip to content

Instantly share code, notes, and snippets.

View TinoDidriksen's full-sized avatar
🐺

Tino Didriksen TinoDidriksen

🐺
View GitHub Profile
// Upper-case because we compare them to DOM nodeName
let text_nodes = {'ADDRESS': true, 'ARTICLE': true, 'ASIDE': true, 'AUDIO': true, 'BLOCKQUOTE': true, 'BODY': true, 'CANVAS': true, 'DD': true, 'DIV': true, 'DL': true, 'FIELDSET': true, 'FIGCAPTION': true, 'FIGURE': true, 'FOOTER': true, 'FORM': true, 'H1': true, 'H2': true, 'H3': true, 'H4': true, 'H5': true, 'H6': true, 'HEADER': true, 'HGROUP': true, 'HTML': true, 'HR': true, 'LI': true, 'MAIN': true, 'NAV': true, 'NOSCRIPT': true, 'OL': true, 'OUTPUT': true, 'P': true, 'PRE': true, 'SECTION': true, 'TABLE': true, 'TD': true, 'TH': true, 'UL': true, 'VIDEO': true};
function findTextNodes(nodes, filter) {
let tns = [], wsx = /\S/;
if (!$.isArray(nodes)) {
nodes = [nodes];
}
@TinoDidriksen
TinoDidriksen / 01-freenode.txt
Last active June 15, 2021 12:49
Freenode Status
-NickServ- Information on TinoDidriksen
-NickServ- Registered : Mar 21 17:25:41 2009
-ChanServ- Information on #apertium
-ChanServ- Founder : spectei
-ChanServ- Registered : Jan 09 18:28:40 2007
-ChanServ- Information on #hfst
-ChanServ- Founder : spectei, Nikerabbit
-ChanServ- Registered : Oct 07 11:15:41 2010
#!/usr/bin/env perl
# -*- mode: cperl; indent-tabs-mode: nil; tab-width: 3; cperl-indent-level: 3; -*-
use warnings;
use strict;
use utf8;
BEGIN {
$| = 1;
binmode(STDIN, ':encoding(UTF-8)');
binmode(STDOUT, ':encoding(UTF-8)');
@TinoDidriksen
TinoDidriksen / Dockerfile
Last active May 10, 2021 11:45
giella-sma-linux
FROM amd64/debian:sid
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
# Upgrade everything and install base builder dependencies
RUN apt-get -qy update && apt-get -qfy --no-install-recommends install apt-utils
RUN apt-get -qy update && apt-get -qfy --no-install-recommends dist-upgrade
RUN apt-get -qy update && apt-get -qfy --no-install-recommends install build-essential fakeroot time libgoogle-perftools-dev
# OS dependencies
# Contents of /opt/mxe/usr/x86_64-w64-mingw32.shared/share/cmake/mxe-conf.cmake
# This file is part of MXE. See LICENSE.md for licensing information.
# https://cmake.org/cmake/help/latest
# Can't set `cmake_minimum_required` or `cmake_policy` in toolchain
# since toolchain is read before CMakeLists.txt
# See `target-cmake.in` for CMAKE_POLICY_DEFAULT_CMPNNNN
#!/bin/bash
P=$PATH
# Unset all envvars
for e in $(env | awk -F"=" '{print $1}') ; do
unset $e ; done
export PATH=$P
export TMPDIR=/tmp
@TinoDidriksen
TinoDidriksen / id_rsa.pub
Created April 12, 2019 15:40
Tino's RSA 4096 bit public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvGE+brgZEcXBjMzFxlMvfzXquB7pxcRG2jCfiBcTtA8ItXUiHigiWhqkj4doxZcPpA7eGv9Se3ULl15fEGboA6fmRTXCboBYSIDE0B/eYkHUsbZKAPcW2NGaPuDiUkaq/wYWgWz9Q4sm8rJNWBUiBLFhwgYnprhiVcNYTqFvcDRq+zE4S4jAD3OCf2MtBA3wt8uV1za2AB3POyaFO/4o+tI8zmA94200zwEJjq2k5v5jTjCR5imKXdPhOnAwXUWVyvwO+urd6mt+ouSZiuxDhS6qnbWqIpfRt4tchgWowCEGFNph25GKIZHr2WEO9OR30HF7n86DP0aor1PeMIL+hQ== Tino@LGR700
#!/usr/bin/perl
# -*- mode: cperl; indent-tabs-mode: nil; tab-width: 3; cperl-indent-level: 3; -*-
use bytes;
use warnings;
use strict;
use Carp qw(verbose);
use Getopt::Long;
use Sendmail::Milter 0.18 qw(:all);
my $rx = '\b(.+\@your\.domain\.com)\b';
@TinoDidriksen
TinoDidriksen / google-mail-compact.js
Created December 22, 2018 13:08
Google Mail Compact
$(function() {
let s = document.createElement('style');
s.textContent = '.zA>.yX {padding-right: 0;} .G-atb {height: 38px; background: rgba(0,0,0,0.16); border-radius: 4px;} .x7 {background: #259;} .Wg {height: 38px;} .Dj {color: #fff;} .TN {height: auto;} .ar {border-radius: 0;} .zA>.a4W {padding-right: 0;} .zA>.yf {display: none;} .zA>.xW {max-width: auto; padding-left: 8px; padding-right: 8px;}';
document.head.appendChild(s);
});
@TinoDidriksen
TinoDidriksen / giella-pkgs.md
Last active February 16, 2018 13:50
Giellatekno Package Subsets

giella-xyz packages contain

  • ./usr/bin/uxyz-gt.sh
  • ./usr/share/giella/xyz/analyser-dict-gt-desc.hfstol
  • ./usr/share/giella/xyz/analyser-dict-gt-desc-mobile.hfstol
  • ./usr/share/giella/xyz/analyser-disamb-gt-desc.hfst
  • ./usr/share/giella/xyz/analyser-disamb-gt-desc.hfstol
  • ./usr/share/giella/xyz/analyser-forcg-desc.hfst
  • ./usr/share/giella/xyz/analyser-forcg-desc.hfstol
  • ./usr/share/giella/xyz/analyser-gramcheck-gt-desc.hfstol
  • ./usr/share/giella/xyz/analyser-gt-desc.hfst