Skip to content

Instantly share code, notes, and snippets.

View webolizzer's full-sized avatar

webolizzer

  • Germany
View GitHub Profile
@webolizzer
webolizzer / jquery-scroll-bottom.js
Created December 27, 2018 20:50 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@webolizzer
webolizzer / profanity.csv
Created February 4, 2018 10:37 — forked from corbanb/profanity.csv
Profanity list for use with content filters
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
amcik
arse
arsehole
arserape
arsewipe
ass
asses
asshole
assholes
assramer
@webolizzer
webolizzer / get_random_guid.js
Last active January 3, 2018 14:19
ES6 random guid generator
var t0 = performance.now();
//
// @source https://gist.github.com/webolizzer/e521db1b1401080b98f06c46c837be6f
//
function get_random_guid() {
const POSSIBILITIES_PER_ROUND = 512;
@webolizzer
webolizzer / insertAtCaret.js
Last active September 27, 2017 13:12
How to insert text into a textarea where the cursor is
//
// jQuery version
// @author https://stackoverflow.com/a/15977052/2337281
// Example Usage:
// <textarea id="txt" rows="15" cols="70">There is some text here.</textarea>
// <input type="button" id="btn" value="OK" />
//
jQuery("#btn").on('click', function() {
@webolizzer
webolizzer / Nginx ACME Challenge.txt
Last active July 17, 2022 00:59
Nginx configuration to enable ACME Challenge support on all HTTP virtual hosts
#@@@ nginx virtual server configuration
### make link
# $ ln -s /etc/nginx/sites-available/DOMAIN_NAME.TLD /etc/nginx/sites-enabled/
# $ nginx -t
# $ systemctl restart nginx
### letsencrypt
# $ cd /PATH_NAME/www
# $ mkdir _.letsencrypt
@webolizzer
webolizzer / commands to install nodejs 8x on ubuntu 16 via cli.md
Last active June 19, 2017 16:21
commands to install node.js 8x on ubuntu 16 via CLI
// install >>>

// easy way

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

// hard way
@webolizzer
webolizzer / thumb-from-input-client-side.html
Last active December 12, 2023 09:02
Create thumbnail from img or video file via file input client-side
<!DOCTYPE html>
<html>
<body>
<script>
// source https://stackoverflow.com/questions/23640869/create-thumbnail-from-video-file-via-file-input
document.addEventListener("DOMContentLoaded", function() {
@webolizzer
webolizzer / Install MariaDB 10.2.6 on Ubuntu 16.04 xenial.md
Last active May 27, 2017 12:52
Install MariaDB 10.2.6 on Ubuntu 16.04 xenial
/**
* @author github.com/webolizzer
* You can buy me a coffee and a Kit-Kat @ paypal.me/webolizzer
* Thank you! :)
*/

// backup old DB

$ cp -a /var/lib/mysql/ /var/lib/mysql.bak

Following instructions at https://mariadb.com/kb/en/mariadb/preparing-for-columnstore-installation/ (There's also https://mariadb.com/kb/en/mariadb/installing-mariadb-deb-files/, but I didn't follow that one.)

Install

sudo apt-get -y install libboost-all-dev expect perl openssl file sudo libdbi-perl libreadline-dev libdbd-mysql-perl
cd ~
wget http://downloads.mariadb.com/MariaDB/mariadb-10.1.22/repo/ubuntu/mariadb-10.1.22-ubuntu-trusty-amd64-debs.tar
cd /opt
sudo tar -xf ~/mariadb-columnstore-tars/mariadb-10.1.22-ubuntu-trusty-amd64-debs.tar
sudo ./mariadb-10.1.22-ubuntu-trusty-amd64-debs/setup_repository
@webolizzer
webolizzer / sysctl.conf
Created April 8, 2017 12:25 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2