Skip to content

Instantly share code, notes, and snippets.

View waimus's full-sized avatar

waimus waimus

View GitHub Profile
@waimus
waimus / kinematicbody_jump.gd
Created August 23, 2022 12:20
The idea is to have easy jump and quick fall. E.g. by lowering the gravity during jump and doubling the gravity during fall (which detected by `velocity.y < 0`).
# No warranty to immediately work. May need additional configuration
export(float) var jump_height : float = 64.0
var world_gravity : Vector3 = Vector3.DOWN * 10.0
var move_velocity : Vector3 = Vector3.ZERO
# Handle player jump movement implenented with KinematicBody
func action_input_jump(delta : float) -> void:
world_gravity = Vector3.DOWN * 10
@waimus
waimus / json_parse_build.vala
Created July 4, 2022 11:23
Vala: build & parse rough example.
// valac --pkg json-glib-1.0 json_parse_build.vala
using Json;
const string JSON_PATH = "/path/to/file.json";
int main() {
build_example();
read_example();
return 0;
}
@waimus
waimus / Timer.cs
Created May 18, 2022 05:17
A component mimicking the behaviour of Godot Engine's Timer node in a simple way. Written for Unity C#
/*
* Timer.cs
* A component mimcking the behaviour of Godot Engine's
* Timer node in a simple way. Written for Unity C#.
* Attach this component to a gameobject for Timer feature
* access from other script in same gameobject.
*
*
* LICENSE
*
@waimus
waimus / colourscheme.md
Last active May 2, 2022 16:23
Terminal colour scheme

waimus-dark

This colour scheme was based on an existing colour scheme but I forget what was it. I made this a long while ago.

Screenshot from 2022-05-02 23-00-55

No. Slot Dark Light
1 Black #2e3436 #555753
2 Red #d62020 #ed333b
@waimus
waimus / ffmpeg-cheatsheet.md
Last active January 7, 2023 07:06
FFMPEG cheatsheet. FFMPEG is magnificent but I don't.

FFMPEG Cheatsheet

personal cheat bookmark of ffmpeg commands I've used. I may only add new cheat whenever I duck-searched ffmpeg commands to use, which I don't use ffmpeg everyday.

Convert video to GIF

ffmpeg -ss 2 -t 9 -i input.mkv -vf "fps=10,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif

Retrieved from: https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality

Trim video

ffmpeg -ss 00:01:00 -to 00:02:00 -i input.mp4 -c copy output.mp4

Retrieved from: https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg

@waimus
waimus / index.html
Last active October 8, 2021 15:57
Custom Firefox homepage.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<style media="screen">
body {
background-color: rgb(28,24,32);
background-image: url(./images/back-blur.webp);
background-size: cover;
background-position: center;
@waimus
waimus / userchrome.css
Created August 31, 2021 04:44
Firefox 91 GNOME Adwaita Theme: Container Color Circle on Tab Fix
/* firefox 91+ */
/* userchrome.css or tabsbar.css */
/* problem: using custom CSS theme such as Firefox Adwaita or WhiteSur put a circle in the tab if the tab opened in a container */
/* solution: */
/* create border that colored with container identifier */
.tabbrowser-tab[class*="identity-color-"] {
border-bottom: 3px solid var(--identity-icon-color) !important;
}
/* Create new container tab indicator */
@waimus
waimus / fake-commit.sh
Last active July 31, 2021 16:12
Fake commit. Wether you want to commit crime, war crime, or what is this example is doing.
#!/usr/bin/env bash
# Fake git commit message
# ------------- customize info here -------------
# Colours
RESET="\033[0m"
C1="\033[0;94m" # intense blue
C2="\033[0;34m" # blue
C3="\033[0;92m" # green

Window Decoration Outline for GNOME/GTK apps

WARNING: This was only tested with GNOME 3.38. No plan on working around with GNOME 40+ and libadwaita.

This will add black and highlight outline to the window decoration for GNOME desktop/GTK apps, it will look similar to how MacOS windows edge look like. Should work well with Adwaita theme.

Screenshot (using AdwaitaEx theme)

screenshot

Rounded teriminal corner is not included, it is from https://github.com/owozsh/adwaita-rounded

@waimus
waimus / userChrome.css
Last active February 16, 2024 18:06
Firefox CSS tabs toolbar auto hide.
/* tab bar auto hide */
@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
/* show tabs toolbar when navigator-toolbox gets hovered */
#main-window:not([customizing]) #navigator-toolbox:hover #TabsToolbar {
visibility: visible !important;
opacity: 1 !important;
margin-bottom: 0px;
transition: visibility 0.1s linear, opacity 0.1s linear, margin-bottom 0.1s linear;