Skip to content

Instantly share code, notes, and snippets.

View gschian0's full-sized avatar

Gennaro Schiano gschian0

View GitHub Profile
@gschian0
gschian0 / repCurl.cs
Created July 29, 2023 23:23
Call Replicate.com API from Unity Engine
//use unity to call replicate api and populate the texture of the 3d object with
//put this script on it with the generated image
using UnityEngine;
using UnityEngine.Networking;
using SimpleJSON;
using System.Collections;
public class repCurl : MonoBehaviour
{
private Renderer objectRenderer; // Reference to the Renderer component of the GameObject
@gschian0
gschian0 / gist:d1544e6459f90ba24ed369f392553c9d
Last active July 29, 2023 20:00
curl request with replicate test in unity c# ... just need to display the image generated as texture2D
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class repCurl : MonoBehaviour
{
private Renderer objectRenderer; // Reference to the Renderer component of the GameObject
private void Start()
{
@gschian0
gschian0 / Button.svelte
Created February 3, 2023 20:20
component to get things
`<script>
let count = 0;
let images = [];
const payload = {
prompt: "zen man",
steps: 5
};
let onSubmit = async () => {
try {
@gschian0
gschian0 / zunix.ipynb
Created November 4, 2022 16:42
ZUNIX.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gschian0
gschian0 / imagemagicheictojpg.ipynb
Last active October 30, 2023 18:21
imagemagicHEICtoJPG.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gschian0
gschian0 / commands.txt
Last active June 27, 2022 02:08
Run Docker with X11 display output on mac
#using osx
#open XQuartx
open -a XQuartz
#set ip link to
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
#set IP with xhost
xhost + $IP
```index.jsx:11 Uncaught (in promise) TypeError: _declarations_contacts__WEBPACK_IMPORTED_MODULE_2__.contacts.insert is not a function
at doInsert (index.jsx:11)
at onClick (index.jsx:58)
at HTMLUnknownElement.callCallback (react-dom.development.js:3392)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3432)
at invokeGuardedCallback (react-dom.development.js:3485)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:3498)
at executeDispatch (react-dom.development.js:7017)
at processDispatchQueueItemsInOrder (react-dom.development.js:7038)
at processDispatchQueue (react-dom.development.js:7047)
import smartpy as sp
#check out this contract in the wild! KT1HUAA7excLzjWq1YNn2ugPwRAqAYg1X5Z1
#I'm still learning so implimenting a balance check with the stake value)
#entry point for all contracts named class and inherited from sp.Contract
class ScrillaBook(sp.Contract):
def __init__(self):
#initialize contract with storage
self.init(
// to add particles in a sphere shape generated as buffer geometry using custom shader
addObjects() {
let that = this;
this.texture = new THREE.TextureLoader().load(particle2);
this.material = new THREE.ShaderMaterial({
extensions: {
derivatives: "#extension GL_OES_standard_derivatives : enable"
},
side: THREE.DoubleSide,
@gschian0
gschian0 / polarWarp.glsl
Created January 30, 2021 03:45 — forked from KeyMaster-/polarWarp.glsl
Cartesian to Polar coordinates warp shader, for shadertoy.com
//To be used on shadertoy.com
//Uses the image at iChannel0 and warps it into polar coordinates
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 relativePos = fragCoord.xy - (iResolution.xy / 2.0);
vec2 polar;
polar.y = sqrt(relativePos.x * relativePos.x + relativePos.y * relativePos.y);
polar.y /= iResolution.x / 2.0;
polar.y = 1.0 - polar.y;