Skip to content

Instantly share code, notes, and snippets.

View kustomzone's full-sized avatar
🚧

Andrew Kidoo kustomzone

🚧
View GitHub Profile
@kustomzone
kustomzone / videos.js
Created May 27, 2021 04:52 — forked from pfrazee/videos.js
Script for encoding & compressing MP4s in the browser
import bytes from '../../vendor/bytes/index.js'
const MAX_WIDTH = 600
const MAX_HEIGHT = 600
const { createFFmpeg, fetchFile } = FFmpeg
let ffmpeg
export async function compressAndGetThumb (file, maxVideoSize, progressCb) {
const objectUrl = URL.createObjectURL(file)
const videoEl = document.createElement('video')
videoEl.addEventListener('error', console.log)
@kustomzone
kustomzone / home-server.md
Created October 26, 2020 13:38 — forked from nileshtrivedi/home-server.md
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@kustomzone
kustomzone / custom_game_engines_small_study.md
Created April 24, 2020 15:22 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus

@kustomzone
kustomzone / WTA_kernel_binary
Created March 3, 2020 08:23 — forked from erogol/WTA_kernel_binary
Google's Winner Takes All hashing implemmentation
function[binary_codes,G_vecs] = WTA_kernel_binary(X,G_vecs,G, K)
% G is number of permutation vectors
% K is the insterest span
if size(G_vecs,1) == 0
G_vec = zeros(G,size(X,2));
for i = 1:G
G_vecs(i,:) = randperm(size(X,2),size(X,2));
end
end
@kustomzone
kustomzone / background.js
Created November 27, 2018 06:48 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@kustomzone
kustomzone / .block
Created April 11, 2017 13:48 — forked from mbostock/.block
GeoJSON in Three.js
license: gpl-3.0
height: 960
border: no
@kustomzone
kustomzone / specialChars.js
Last active March 17, 2017 15:50 — forked from alexgibson/specialChars.js
encode & decode special chars
//encodes special characters
function encodeString(str) {
return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g, '&#x2F;').replace(/=/g, '&#x3D;');
}
//decodes special characters
function decodeString(str) {
return str.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#x27;/g, '\'').replace(/&#x2F;/g, '/').replace(/&#x3D;/g, '=');
}