Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding

Teocci teocci

👨‍💻
Coding
View GitHub Profile
@teocci
teocci / shader.frag.glsl
Created Aug 10, 2022
Vertex and Fragment shaders
View shader.frag.glsl
/**
* Uber Shader
* Shader used as a Verold material type
*
* Written by Mike Bond
* March 2012
*/
#define ALPHA_TEST_LEQUAL 0
#define ALPHA_TEST_GREATER 1
View verold_api_v1.0.6.js
This file has been truncated, but you can view the full file.
var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
View verold_api_v1.js
var requirejs,require,define;(function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice;function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,foundI,foundStarMap,starI,i,j,part,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseParts.slice(0,baseParts.length-1);name=baseParts.concat(name.split("/"));for(i=0;i<name.length;i+=1){part=name[i];if(part==="."){name.splice(i,1);i-=1}else if(part===".."){if(i===1&&(name[2]===".."||name[0]==="..")){break}else if(i>0){name.splice(i-1,2);i-=2}}}name=name.join("/")}else if(name.indexOf("./")===0){name=name.substring(2)}}if((baseParts||starMap)&&map){nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice
@teocci
teocci / download-vs-code-server.sh
Created Jul 25, 2022
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
View download-vs-code-server.sh
#!/bin/sh
set -e
# Auto-Get the latest commit sha via command line.
get_latest_release() {
tag=$(curl --silent "https://api.github.com/repos/${1}/releases/latest" | # Get latest release from GitHub API
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' ) # Pluck JSON value
@teocci
teocci / aapl.csv
Last active Jun 23, 2022
These simple CSV files store data used to draw charts using D3
View aapl.csv
date close
2007-04-23 93.24
2007-04-24 95.35
2007-04-25 98.84
2007-04-26 99.92
2007-04-29 99.8
2007-05-01 99.47
2007-05-02 100.39
2007-05-03 100.4
2007-05-04 100.81
View Windows-god-mode.md

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

@teocci
teocci / encode-decode-html.js
Created May 31, 2022
HTML encode decode (Pure Javascript)
View encode-decode-html.js
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;
View connect-to-mariadb-remotly.md

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';

View avi_samsung_xvid_fix.ps1
<#
.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
How to setup a git server on Ubuntu 20.04
View how-to-setup-git-server.md

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