Skip to content

Instantly share code, notes, and snippets.

View paranoiq's full-sized avatar
🍵
418 I am a teepot

Vlasta Neubauer paranoiq

🍵
418 I am a teepot
View GitHub Profile
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@paranoiq
paranoiq / key.regexp.txt
Last active January 3, 2024 14:30
public RSA key validation regexp
#ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3} ([^@]+@[^@]+)#
// this is the most simple case. see more complete regexps in coments below
// http://generator.my-addr.com/generate_ssh_public_rsa_key-private_rsa_key-ssh_pair_online_tool.php
// https://help.ubuntu.com/community/SSH/OpenSSH/Keys
// http://www.ietf.org/rfc/rfc4716.txt
@paranoiq
paranoiq / index.php
Created November 29, 2022 12:25
Generator of the Supersymmetric Table of Cellular Automata
<?php
error_reporting(E_ALL);
function bin(int $n): string
{
$bin = str_pad(decbin($n), 8, '0', STR_PAD_LEFT);
return substr($bin, 0, 4) . ' ' . substr($bin, 4, 4);
}
@paranoiq
paranoiq / aaa.txt
Created February 15, 2011 18:24
Cross-browser styling of <fieldset> and <legend> without any additional HTML elements
formátování <fieldset> a <legend> je opravdu vojeb. veškerá řešení,
která jsem našel vyžadovala přidat do kódu nějaké pomocné <div>y nebo
<span>y. takové řešení mi ale nevyhovuje
nakonec jsem dospěl k tomuto. vypadá na pixel stejně ve všech novějších
prohlížečích včetně IE7. v IE6 a starších (bez selektorů + a >) nefunguje
falešný padding
@paranoiq
paranoiq / es.json
Last active October 5, 2022 15:40
ElasticSearch Query Language idea...
{
"fields": [
"id",
"startTime",
"priority",
"malePriority",
"lastFourDaysMaleViewsInCity1",
"commissionPerVisit",
"lastFourDaysViewsInCity1",
"lastFourDaysViews"
<?php declare(strict_types = 1);
/**
* This file is part of the SqlFtw library (https://github.com/sqlftw)
*
* Copyright (c) 2017 Vlasta Neubauer (@paranoiq)
*
* For the full copyright and license information read the file 'license.md', distributed with this source code
*/
// phpcs:disable Squiz.Arrays.ArrayDeclaration.ValueNoNewline
@paranoiq
paranoiq / adminer.css
Last active July 17, 2019 10:00
Paranoiqův styl pro Adminer
/**
* Alternative style for Adminer. Zrobeno 7.4.2011
* @author Vlasta Neubauer [@paranoiq]
*/
/* -- fonts ----------------------------------------------------------------- */
body {
font-size: 11pt;
}
body, select, option, optgroup, button {
@paranoiq
paranoiq / makeScrollable.js
Created August 24, 2011 16:18
Scrollable table body
/**
* Make table body scrollable, with the table header always visible.
* Table shrinks vertically to fit the browser viewport.
*
* requirements:
* - jQuery framework required (tested with 1.6.2)
* - header must be wrapped in <thead> element
*
* warnings:
* - table <caption> is not supported
- rule for Rewriter extension for Chrome
- makes gist editation window on GitHub much bigger
"match": ["rows=\"17\""], "substitute": "rows=\"80\"", "url": ["https://gist.github.com"];
@paranoiq
paranoiq / check_foreign_keys.sql
Last active December 25, 2015 16:29
vygeneruje SQL pro kontrolu integrity celé databáze, pokud někdo vypnul cizí klíče a rozbil data
SELECT
/*fk.CONSTRAINT_SCHEMA,
fk.CONSTRAINT_NAME,
fk.TABLE_NAME,
col.COLUMN_NAME,
fk.REFERENCED_TABLE_NAME,
col.REFERENCED_COLUMN_NAME,*/
CONCAT('SELECT * FROM `', fk.TABLE_NAME, '` WHERE `', col.COLUMN_NAME, '` NOT IN (SELECT `', col.REFERENCED_COLUMN_NAME, '` FROM `', fk.REFERENCED_TABLE_NAME, '`);') AS query
FROM `REFERENTIAL_CONSTRAINTS` fk
JOIN KEY_COLUMN_USAGE col USING (CONSTRAINT_SCHEMA, CONSTRAINT_NAME)