Skip to content

Instantly share code, notes, and snippets.

View teocci's full-sized avatar
👨‍💻
Coding

Teocci teocci

👨‍💻
Coding
View GitHub Profile

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

@teocci
teocci / encode-decode-html.js
Created May 31, 2022 09:32
HTML encode decode (Pure Javascript)
function html_decode(text){
var div = document.createElement("div");
div.innerHTML = text;
return ("textContent" in div) ? div.textContent : div.innerText ;
}
function html_encode(str){
var div = document.createElement("div");
div[("textContent" in div) ? "textContent" : "innerText"] = str;
return div.innerHTML;
@teocci
teocci / connect-to-mariadb-remotly.md
Created May 26, 2022 10:58
How to Connect to MariaDb

Enable Remote Connections and Grant Privileges If the MariaDb connection is only working locally, make sure the user has been granted privileges to be able to connection remotely to MariaDb. Follow the next steps to grant the user remote access or privileges:

Windows The easiest way to do this is during installation. Read Guided MariaDb Windows Installation to learn now. Open the command prompt by following this steps: Start -> run -> cmd -> press enter. Navigate to your MariaDb installation folder (Default: C:\Program Files\MariaDb\MariaDb Server 12\bin) Type in: mysql -u root -p GRANT ALL PRIVILEGES ON . TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';

<#
.SYNOPSIS
Use this script to fix AVI Xvid or DivX files to be playable on newer Samsung TV's
Do not run this script from Powershell ISE, only run from Powershell terminal window or Windows Terminal
Prerequisite: ffmpeg.exe in global path
#>
# if you want to backup files first before processing set this variable value to $true
[bool] $EnableBackup = $false
@teocci
teocci / how-to-setup-git-server.md
Created May 20, 2022 01:33
How to setup a git server on Ubuntu 20.04

Installing Git server

First, lets update our packages list by running:

sudo apt update

To install Git, run the following command:

sudo apt install git
{"SPoint":{"x":127.394437,"y":36.429879},"EPoint":{"x":127.394437,"y":36.429879},"SPointList":{"nodes":[{"x":127.397855,"y":36.431228},{"x":127.390672,"y":36.43136},{"x":127.397145,"y":36.432055},{"x":127.39206,"y":36.429329},{"x":127.397765,"y":36.428733},{"x":127.396261,"y":36.43285},{"x":127.390722,"y":36.427284},{"x":127.392599,"y":36.431819},{"x":127.392927,"y":36.427562},{"x":127.392903,"y":36.429079},{"x":127.397637,"y":36.431494},{"x":127.395297,"y":36.43068},{"x":127.392292,"y":36.431341},{"x":127.392435,"y":36.428356},{"x":127.397793,"y":36.431304},{"x":127.387853,"y":36.426849},{"x":127.387584,"y":36.432675},{"x":127.396505,"y":36.429736},{"x":127.393003,"y":36.432652},{"x":127.387456,"y":36.431508},{"x":127.399812,"y":36.435486},{"x":127.395734,"y":36.429263},{"x":127.393302,"y":36.431215},{"x":127.400448,"y":36.434994},{"x":127.397948,"y":36.428587},{"x":127.391594,"y":36.430283},{"x":127.394219,"y":36.432633},{"x":127.397419,"y":36.431758},{"x":127.398919,"y":36.42899}]}}
{"shortest_time":0.000013,"TSP_time":0.000007,"SPathList":{"use_time":2329.024639,"paths":[{"id":1,"cost":687.74761,"SLineString":{"nodes":[{"y":36.430349,"x":127.38495},{"y":36.430249,"x":127.385259},{"y":36.429951,"x":127.385133},{"y":36.429885,"x":127.385122},{"y":36.42987,"x":127.385129},{"y":36.429745,"x":127.385183},{"y":36.429677,"x":127.385187},{"y":36.429628,"x":127.385171},{"y":36.42943,"x":127.385076},{"y":36.429285,"x":127.385007},{"y":36.428865,"x":127.384805},{"y":36.428522,"x":127.385862},{"y":36.428453,"x":127.386011},{"y":36.428741,"x":127.386148},{"y":36.431508,"x":127.387456},{"y":36.431587,"x":127.387494},{"y":36.431508,"x":127.387456},{"y":36.431525,"x":127.387393}]},"EPoint":{"y":36.431525,"x":127.387393},"SPoint":{"y":36.430246,"x":127.384917}},{"cost":1041.94969,"id":2,"SLineString":{"nodes":[{"y":36.431525,"x":127.387393},{"y":36.431508,"x":127.387456},{"y":36.428741,"x":127.386148},{"y":36.428453,"x":127.386011},{"y":36.428283,"x":127.386449},{"y":36.428235,"x":127.38656},{"y":36.427
{"FixPoint":{"pts":[{"y":36.427786,"x":127.391044},{"y":36.433517,"x":127.402162},{"y":36.428918,"x":127.394424},{"y":36.434694,"x":127.394077},{"y":36.430548,"x":127.395467},{"y":36.428671,"x":127.392639},{"y":36.431525,"x":127.387393},{"y":36.429471,"x":127.397108},{"y":36.431421,"x":127.390705}],"EPoint":{"y":36.430404,"x":127.386293},"SPoint":{"y":36.430404,"x":127.386293}}}
package main
import (
"path"
"path/filepath"
"runtime"
)
var (
// Current working directory

Annual Percentage Rate (APR) and Annual Percentage Yield (APY) may seem similar, but knowing the difference and how they are used will help you make better financial decisions.

Compounding Period
Annually 1
Semi-Annually 2
Monthly 12
Weekly 52
Daily 365