Skip to content

Instantly share code, notes, and snippets.

View waimus's full-sized avatar

waimus waimus

View GitHub Profile
@waimus
waimus / dock-panel-toggle.sh
Created January 15, 2021 16:55
Toggle dash-to-dock extend panel height settings when run. Attach this script to a keyboard shortcut via GNOME settings for handy use. This script uses dconf.
# Retrieving current condition of the panel
isExtended=$(dconf read /org/gnome/shell/extensions/dash-to-dock/extend-height)
# Invert condition
if [ "$isExtended" = true ] ; then
dconf write /org/gnome/shell/extensions/dash-to-dock/extend-height false
else
dconf write /org/gnome/shell/extensions/dash-to-dock/extend-height true
fi
@waimus
waimus / userChrome.css
Last active February 9, 2021 23:56
waimus' Firefox CSS basic customization. Uses additional CSS file linked in the file.
/*https://www.userchrome.org/*/
/*more stuff at https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome*/
@import url("./window_control_placeholder_support.css"); /*from: https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/window_control_placeholder_support.css*/
@import url("./tabs_on_bottom.css"); /*from: https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/tabs_on_bottom.css*/
/*
Additional modification from external css above help to tweak the look better.
i.e:
@waimus
waimus / stylesheet.css
Last active April 4, 2021 12:06
Dash-to-Dock custom stylesheet. Featuring grey inner line and black outer line, like MacOS window edge style. And round every corner.
/* Shrink the dash by reducing padding */
#dashtodockContainer.shrink #dash,
#dashtodockContainer.dashtodock #dash {
border:1px;
padding:1px 0px 1px 0px;
}
#dashtodockContainer.shrink.left #dash,
#dashtodockContainer.dashtodock.left #dash {
border-left: 0px;
@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
@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 / 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 / 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 / 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 / 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 / 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