Skip to content

Instantly share code, notes, and snippets.

@giventofly
giventofly / linux keyboard not detected on boot need to replug
Created June 24, 2022 11:01
linux keyboard not detected on boot need to replug
https://forums.linuxmint.com/viewtopic.php?f=49&t=287775&p=1593262&hilit=SOLVED+USB+Ports+Working+Correctly#p1593262
tldr: add on grub boot: quiet splash usbcore.autosuspend=-1
@giventofly
giventofly / fix mysql database error MySQL table is marked as crashed and last (automatic?) repair failed.md
Last active June 19, 2022 11:37
fix mysql database error MySQL table is marked as crashed and last (automatic?) repair failed
@giventofly
giventofly / readme.md
Last active May 30, 2022 13:05
citrix linux use control key
@giventofly
giventofly / cookies.js
Created May 4, 2022 22:19
javascript cookies
//src: https://www.quirksmode.org/js/cookies.html
const createCookie = (name,value,days)=> {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
@giventofly
giventofly / citrix.md
Created May 2, 2022 13:51
citrix linux error quovadis root ca 2 g3 ssl error 61 linux
@giventofly
giventofly / debounce.js
Created March 17, 2022 21:07
debounce javascript
//search decks
document.getElementById("decktosearch").addEventListener("keyup", debounceSearchDeck);
const debounce = (callback, wait) => {
let timeoutId = null;
return (...args) => {
window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => {
callback.apply(null, args);
@giventofly
giventofly / truncateString.js
Created March 1, 2022 10:37
truncate string max chars
//https://stackoverflow.com/a/44821227/10829833
function truncateString(text, count, insertDots){
return text.slice(0, count) + (((text.length > count) && insertDots) ? "..." : "");
}
@giventofly
giventofly / truncate.php
Created November 5, 2021 12:29
php truncate number
<?php
//https://stackoverflow.com/questions/4668628/truncate-float-numbers-with-php/12710283#12710283
function truncate($val, $f="2"){
if(($p = strpos($val, '.')) !== false) {
$val = floatval(substr($val, 0, $p + 1 + $f));
}
return $val;
}
@giventofly
giventofly / mouse ubuntu bluetooth lag.md
Created October 12, 2021 09:08
mouse ubuntu bluetooth mx master 3
sudo nano /var/lib/bluetooth/xx:xx:xx:xx:xx:xx/yy:yy:yy:yy:yy:yy/info
[ConnectionParameters]
MinInterval=6
MaxInterval=7
Latency=0
Timeout=216
@giventofly
giventofly / gist:6ef71d1aaf846a509a28d706d8d5ef00
Created August 13, 2021 13:41
function keys fn keys linux
google for ibus