Skip to content

Instantly share code, notes, and snippets.

View hiulit's full-sized avatar
💻
Working

hiulit

💻
Working
View GitHub Profile
@tokland
tokland / video-resize.sh
Last active December 25, 2017 22:31
Resize videos to a fixed size with avconv
#!/bin/sh
#
# Resize videos to a given size.
# Depedencies: libav
debug() {
echo "$@" >&2
}
to_num() { local NUM_STRING=$1
@heloa-net
heloa-net / How-to.md
Created January 4, 2017 01:58
Hiding API keys on GitHub without breaking your project

Backup the API key beforehand in case you have trouble reverting the file.

Let's say the file with a key you want to hide is <filename> Open it and change the API key with a placeholder, like <api-key> Save and add the file to git and commit git commit -m 'Masking API key'

Then revert the file, undoing recent changes so your key is back where it should be and save it. Use git update-index --assume-unchanged

@silverkorn
silverkorn / godot-cross-compile.sh
Last active December 30, 2020 23:26
Godot Engine cross-compiling helper attempt for Linux x11 ARM (and potentially others).
#!/usr/bin/env bash
function usage() {
echo "Usage: $(basename $0) TARGET_ARCH TARGET_OS [SCONSOPTS]"
echo "Helper to cross-compile Godot game engine [https://godotengine.org/] on other Linux architectures.".
echo
echo "The TARGET_ARCH is the target architecture/device to compile to."
echo " List of available TARGET_ARCH"
echo " rpi2"
echo " rpi3"
@jordanlis
jordanlis / godot_2d_wind_shader.txt
Last active January 21, 2021 01:52
godot 2D wind shader
// original wind shader from https://github.com/Maujoe/godot-simple-wind-shader-2d/tree/master/assets/maujoe.simple_wind_shader_2d
// original script modified by HungryProton so that the assets are moving differently : https://pastebin.com/VL3AfV8D
//
// speed - The speed of the wind movement.
// minStrength - The minimal strength of the wind movement.
// maxStrength - The maximal strength of the wind movement.
// strengthScale - Scalefactor for the wind strength.
// interval - The time between minimal and maximal strength changes.
// detail - The detail (number of waves) of the wind movement.
// distortion - The strength of geometry distortion.
@Sephirothphoenix
Sephirothphoenix / Crystal.shader
Created February 25, 2021 05:58
Robe Shaders (Golden Scythe, Godot)
shader_type canvas_item;
void fragment() {
// Color of the current pixel
vec4 oC = texture(TEXTURE, UV);
// Get the difference between the current pixel color and the color to replace, and replace the color
// Exterior Main
if (max(max(max(abs(oC.r - 0.408), abs(oC.g - 0.282)), abs(oC.b - 0.471)), abs(oC.a - 1.0)) <= 0.01){oC = vec4(
@cenullum
cenullum / circle.shader
Created October 18, 2020 16:30
Godot Engine Circle with Outline Color Shader
shader_type canvas_item;
uniform vec4 outline_color:hint_color = vec4(1.0,1.0,0.0,1.0);
uniform float inner_circle=0.45;
uniform float outer_circle=0.5;
const vec4 alpha_color= vec4(0,0,0,0);
uniform float smoothness=0.01;
@fenix-hub
fenix-hub / dateToUnixTimestamp.gd
Last active February 11, 2022 19:21
Converts an ISO 8601 Date String to UNIX Timestamp int
# The best option is always to confront dates based on their UNIX value
# With these scripts, you'll get something like "16778909182". Put it in the Array and sort it with the others.
var timestamp: String = "2021-08-04T16:45:35.603Z"
# Using String, Arrays and Dictionary
var datetime: PoolStringArray = timestamp.split("T")
var date: PoolStringArray = datetime[0].split("-")
var time: PoolStrngArray = datetime[1].split(":")
var unix_timestamp: int = OS.get_unix_time_from_datetime({year=date[0],month=date[1],day=date[2],hour=time[0],minute=time[1],second=time[2].substr(0,2)}
@1nVitr0
1nVitr0 / autocollection.sh
Last active April 10, 2022 21:01
Shell Script for automatically creating file collections, e.g. for games
# Shell script for automatically creating file collections
# initally written to reduce the number of games when downloading
# retropie rom collections
#!/bin/bash
version="0.3.1"
collection=()
collectionname=""
collsize=0
@AnidemDex
AnidemDex / flow_container.gd
Last active April 24, 2022 16:27
Node Container that wraps its childs nodes in its rect
tool
extends Container
#class_name FlowContainer
## Modified version of
## https://github.com/godotengine/godot/pull/56104 to be used in versions previous 3.5
## by AnidemDex
## Use it as you want
@damc-dev
damc-dev / menu.sh
Created May 30, 2017 13:28
Bash menu select option
#!/bin/bash
# Bash Menu Script Example
PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option 3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Option 1")
echo "you chose choice 1"