Skip to content

Instantly share code, notes, and snippets.

View devrique's full-sized avatar
🏠
Working from home

devrique

🏠
Working from home
View GitHub Profile
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 16, 2024 21:20
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@h3r2tic
h3r2tic / raymarch.hlsl
Last active May 9, 2024 12:04
Depth buffer raymarching for contact shadows, SSGI, SSR, etc.
// Copyright (c) 2023 Tomasz Stachowiak
//
// This contribution is dual licensed under EITHER OF
//
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
// MIT license (http://opensource.org/licenses/MIT)
//
// at your option.
#include "/inc/frame_constants.hlsl"
@Gnumaru
Gnumaru / GdscriptCallSequence.txt
Last active March 19, 2024 03:00
The sequence in which methods and signals gets called in gdscript
# as of godot 4.1
_static_init
_init
_notification 20 Node.NOTIFICATION_SCENE_INSTANTIATED # only on instantiated scene roots
_notification 18 Node.NOTIFICATION_PARENTED
_enter_tree
tree_entered signal
_notification 27 Node.NOTIFICATION_POST_ENTER_TREE
_ready
ready signal
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@sebastian13
sebastian13 / synology-commands.sh
Created August 30, 2019 18:14
Collection of useful terminal commands for Synology DS.
# Renew Let's Encrypt Certificates
/usr/syno/sbin/syno-letsencrypt renew-all
# Disable Firewall
/usr/syno/bin/synofirewall --disable
@anorth
anorth / ZoomLayout.java
Created March 29, 2014 00:06
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
@RamonGilabert
RamonGilabert / bluetooth.sh
Last active October 12, 2023 18:24
Bluetoothctl automation
#!/usr/bin/expect -f
set prompt "#"
set address [lindex $argv 0]
spawn sudo bluetoothctl -a
expect -re $prompt
send "remove $address\r"
sleep 1
expect -re $prompt
@belen-albeza
belen-albeza / empanada_gallega.md
Created February 15, 2013 08:53
Empanada gallega (receta de Urtzi)

Empanada gallega

La receta legendaria de empanada gallega de Urtzi.

Masa

Ingredientes:

  • Una tacita pequeña (como de espresso) de vino blanco
  • La misma cantidad de aceite
@saward
saward / godot_recursive_move.gd
Last active July 15, 2022 05:46
Example of Godot path movement using recursion
# MIT licenced. Feel free to use in your project.
# Use recursion to move along path. We move along path, and if there's any
# distance remaining, we call this function again and move further along until
# we reach our destination or there's no distance left to travel
func move_along_path(distance : float) -> void:
# Ensure we have an actual path, otherwise we are done and can stop
# processing
if path.size() == 0:
set_process(false)
return
@athalean
athalean / pathfinding.gd
Created March 9, 2017 09:15
Godot A* pathfinding
func grid_to_world(position):
# (0,8) is the offset to the middle of the tile
return map_to_world(position) + Vector2(0, 8)
func world_to_grid(position):
return world_to_map(position)
func get_tile_cost(pos):
# placeholder
return 1.0