Skip to content

Instantly share code, notes, and snippets.

View ohms064's full-sized avatar

Omar Rodríguez Pérez ohms064

View GitHub Profile
@ohms064
ohms064 / gamesave.jslib
Created February 8, 2021 09:41
Unity Firebase with WebGL
mergeInto(LibraryManager.library, {
UpdateStartGame: function() {
console.log("Update: " + startGame);
updateStats({
property: startGame
})
.then(function(result) {
console.log("Update game states result: " + result);
})
.catch(function(error) {
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>%UNITY_WEB_NAME%</title>
<!-- COPIA Y PEGA AQU� EL CODIGO BRINDADO POR FIREBASE -->
<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->
@ohms064
ohms064 / NearestPot.py
Created October 14, 2019 19:08
Python script which converts an image size to the closest pot of 2 greater than the current size.
import os
from PIL import Image, ImageOps
def GetNeartestPot2(val, pot = 256, previous = 128):
if pot < val:
return GetNeartestPot2(val, pot * 2, pot)
else:
upper = abs(val - pot)
lower = abs(val - previous)
if upper < lower: