Skip to content

Instantly share code, notes, and snippets.

View AquariusPower's full-sized avatar
"truth is a pathless land" - J.K


"truth is a pathless land" - J.K
View GitHub Profile
AquariusPower / FlexibleVotingSystem.txt
Last active March 1, 2016 23:17
Flexible voting system for applications and websites: Favorites, Kudos and Sub-scores. Also Bookmarks and Hashtags considerations.
What we have today, in many applications and sites, [is a bookmarks system miscalled as "favorites"](
- Like/Dislike, Up/Down: so here we have the current voting system, simple, fast (concerning how long we decide on casting a vote), but limited, we cant do much more other than comments that can't be properly queried/quantified.
- Favorites: should mean something you like more then other things, something that comes before others. [This query](, unfortunately, has dubious significance nowadays.
- Bookmark: is something you intend to look at, at a later time, and within the bookmarks you can have your favorites, but, despite being on a similar context, they are clearly two different concepts. You can have thousands of bookmarks but you only like or need to revisit a handful of them.
AquariusPower /
Last active March 13, 2016 05:16
Graphical commands console for Lemur GUI (JMonkeyEngine)
Code migrated to:
package tests;
import com.jme3.math.Vector3f;
import com.jme3.system.AppSettings;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Command;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.GuiGlobals;
import com.simsilica.lemur.Label;
function FUNCconv() {
local lstrFile="$1"
if [[ ! -f "$lstrFileWebp" ]];then
echo ">>> working with $lstrFile <-> $lstrFileWebp"
AquariusPower /
Last active March 27, 2018 03:15
How To Let Project Files For Many Developers Be Commited On The Same Repo

my .gitignore added text:

## Eclipse developers preferences over different operational systems
## and personalized configurations.

# link to some user folder at /.devsPrefs
AquariusPower /
Last active December 17, 2018 17:14
Always welcome contributors, always!!

We should not annoy people willing to contribute with their spare time, ideas and energy, for free, to projects they love, because of minor things, or what will probably happen is that people will just create and distribute their forks to escape from being bossed around like they are in their most probably oppressive jobs everywhere in this non utopic world. Just consider that they could be at parties having fun and many endless pleasures but they are sat behind their bright monitors, with a noisy fan nearby, focusedly coding to help us improve such marvels! Aww dammit! Did I just woke up some potential developer :o ?

* Copyright (C) 2017 Alberts Muktupāvels
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
AquariusPower / gist:19a71dfe1f683c5807cd452ae32513fb
Created May 31, 2020 20:57
Nesting another answer from the same site letting it be externally updated.
There are several questions about duplicating other user answer or just copying own answer etc...
This new feature would allow us to paste the link in a special way, that would show the other answer contents while having our own considerations above or below it.
When it is updated there, such changes would be shown on the nested contents too.
It could even be cross-site, as long such sites are from the same group (this means it uses the same safe content rules of text and media), and it could store the external site contents in a cache, in case the other site goes offline (like google caches homepages even in simple text).
The idea is, as the external answer won't apply word to word, our considerations would make the nested answer coherent with the current question, in wich case it would not be a duplicate.
AquariusPower / HardRemapLinuxKeyboardKey.txt
Created September 11, 2020 05:47
Example on how to (low level) hard remap a keyboard key on linux
$sudo evtest #the keyboard was input 5 here, I wanted to make KeyPad0 work as LeftAlt key
Select the device event number [0-22]: 5
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1a2c product 0x3d43 version 0x110
Input device name: "SEMICO USB Keyboard"
Event: time 1599799246.967341, -------------- SYN_REPORT ------------
Event: time 1599799247.011339, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 2
Event: time 1599799247.011339, -------------- SYN_REPORT ------------
AquariusPower /
Last active January 22, 2021 22:00
stress test flock
#trash /tmp/flock.tst.log;for((i=0;i<20;i++));do;done #run this on shell
#trash /tmp/flock.tst.log;iSpawns=20;while true;do for((i=0;i<$iSpawns;i++));do;done; sleep $((60*(iSpawns+2)));done #run this on shell to make the test run forever (untill killed), remove the outer loop to prevent endless test.
#pkill -fe #end all concurrent children trying to acquire the lock
#while true;do date;lslocks |grep flock;sleep 1;done #use this to check if there is more than one lock acquired, check also the log file to confirm it, and if there is two subsequent WORK on the terminal log, it means a problem happened too