Skip to content

Instantly share code, notes, and snippets.

View opyate's full-sized avatar
🐠
Fishing.

Juan M Uys opyate

🐠
Fishing.
View GitHub Profile
@opyate
opyate / snippets.py
Last active November 24, 2017 11:29
deeplearning.ai week 2 code snippets
import numpy as np
# Activation functions
sigmoid = lambda x: 1 / (1 + np.exp(-x))
# tanh is just np.tanh
relu = lambda x: np.maximum(0, x)
leaky_relu = lambda x: np.maximum(0.001*x, x)
def sigmoid_derivative(x):
s = sigmoid(x)
@opyate
opyate / env.yml
Last active February 15, 2018 12:28
name: synth36
channels:
- conda-forge
- defaults
dependencies:
- backports
- backports.functools_lru_cache
- blas
- bzip2
- ca-certificates
@opyate
opyate / change_git_submodule.md
Last active March 10, 2020 10:35
Change a git submodule remote

To change a git submodule's remote (in this case, from HTTPS to SSH):

SUB=my-submodule-name
$REMOTE=git@gitlab.com:path/to/remote.git

git submodule deinit $SUB
git rm $SUB
git commit -m "removed $SUB submodule at https remote"

rm -rf .git/modules/$SUB

This is a combination of

  • stapler
  • scissors
  • knocking on a window (reversed)
  • wobbling an A4 sheet of thin cardboard
  • sticky tape coming unstuck (with reverb)

Made with Audacity.

@opyate
opyate / singleton.gd
Last active May 8, 2021 20:41
Global music for a Godot game, with fade-in if the song is made for looping (i.e. starts of loudly)
extends Node
func _ready():
var fade_in = Tween.new()
add_child(fade_in)
var music = AudioStreamPlayer.new()
add_child(music)
var stream = load("res://assets/audio/music/song.ogg")
music.set_stream(stream)
music.pitch_scale = 1
@opyate
opyate / README.md
Last active April 23, 2026 17:46
Simple no-cache gamedev-friendly Python 3 webserver for testing web builds locally

(blog post)

Seeing this when running an HTML5 Godot game?

image

This is a simple no-cache Python 3 gamedev-friendly webserver which runs on port 4443.

Run with

@opyate
opyate / README.md
Created April 29, 2022 14:51
Rename Barclays statements

Renames statements from statements/Statement 17-dec-21 ac 01234567.PDF to statements/2021-12-17.pdf, as the latter is more easily sortable in a folder.

@opyate
opyate / Debounce.gd
Last active February 24, 2023 15:11
Godot 3 debouncer, tested on 3.5.1
class Debounce:
var _tree: SceneTree
var _timer: SceneTreeTimer
var _wait: float
var _fn: FuncRef
func _init(tree: SceneTree, fn: FuncRef, wait: float = 0.15):
_tree = tree
_fn = fn

With regards to artists not wanting their art scraped by AI, I just looked at a random image off Behance.

What in this EXIF data can tell the bot to ignore this image? (e.g. CC license)

random image off Behance