maanoo/blog

Wednesday, September 24, 2025

Javascript: Avoiding the JsDoc

›
 We all want the types of Typescript without the Typescript, for the best friend to every human code generator: the members suggestion list ...
Monday, May 12, 2025

Web: Packaging assets to a binary the web way

›
We have a game in html with a bunch of images and sound effects. Instead of having a bunch of requests, we want to package all the asset fil...
Saturday, May 10, 2025

Javascript: Unexprected Symbol.iterator

›
Lets validate some data, and lets do some smart checks with a unknown random schema. Lets same why wnat to check internal id references, and...
Wednesday, April 16, 2025

Techniques: Dev inplace replacement code

›
You have your utils.js with the classic document.querySelector shortcut: function q(selector) { return document.querySelector(selecto...
Monday, April 7, 2025

Web: Bundle and deploy with php and make

›
 We want to put all the things into a single index.html and then uploaded. We just: index.html: index.php $(shell find src -type f) php...
Friday, August 23, 2024

Techniques: From code to data and back to code

›
Lets create a series of fields: { container.add(new Field("name", "text")); container.add(new Field("surname...
Sunday, June 23, 2024

Decline of Thought: Tailwind CSS

›
Top "css library" of 2020s, tailwind css with the its message "Rapidly build modern websites without ever leaving your HTML...
Thursday, June 20, 2024

Html: Write the tags of your dreams

›
Lets say we want to write some quick html and js thing to test something. We want a text field and a button to login with a username and if ...

Techniques: Multiple localhost sessions

›
Lets assume you have an web app with some sort of login system, and you are testing things on a local web server bound to "localhost...
Wednesday, May 1, 2024

Techniques: Patch files

›
Create a patch file: Locate the file we want to change, eg. path/file.json Create a copy of the file and edit it in the same directory, e...
Friday, November 10, 2023

JavaScript: Generic selector proxied object

›
Lets create a thing to replace the very simple selector calls for id and classes. First lets have simple selector for both the id and single...
Saturday, September 16, 2023

Review: Oppenheimer

›
This is a review of the film Oppenheimer (2013), the depiction of Oppenheimer's life and his actual life based on the same depiction. Op...
Wednesday, August 2, 2023

Windows: Single click to open

›
So while I was traveling through the menus to change the 'Show hidden files' options in a new Windows system I was cursed to used, I...
Wednesday, November 9, 2022

LibGDX: Blending in html gwt web

›
If you use OpenGl blending functions, you probably are doing something with the alpha buffer (or not). By default the alpha buffer is disabl...
Tuesday, July 19, 2022

Html: Enter handler on input text field

›
Every single time you have a input text field and submit-like button next to it, at some point, you would like to bind the same action of th...
Sunday, June 26, 2022

Html: Unwanted cached resources

›
So as you write a simple a html file with one or two resources, lets say one css and one js file, and you then deploy it (= copy paste) to a...
Saturday, September 18, 2021

Python: Easy help print

›
As a follow up of the "Bash: Easy help print", lets do the same thing. So I will just copy the whole text and replace what needs r...
Wednesday, June 16, 2021

Javascript: Self call re-call interval set

›
 So we have the requestAnimationFrame, you pass a function and it called after a very specific while (irrelevant to the following). Now lets...

Techniques: Build-time pre-package capture

›
 Usually when things/files are packaged from simple files to single monstrosity, you no longer have the ability to ls/dir to lookup what thi...
Friday, June 11, 2021

Html: Input tag drop-down list

›
The classic way to have a drop-down list in html is the select tag. However there are two main problems/inconvenient. The select tag will on...
Friday, March 5, 2021

Email: Why are you tracking me in "secret"

›
So Aege@n (airline) has been spamming me with emails after a took a single flight with them. One day they actually sent an email with the su...
Wednesday, February 24, 2021

Python: Easy line plots

›
Need to just plot a file with numbers? Stop using matl@b or exc € l. All we need is a couple lines of Python code: import matplotlib.pyplot ...
Sunday, February 7, 2021

Bash: Easy help print

›
Ok, lets create a single line of bash that will handle the -h option and print something. First, what to print? I usually add some comments ...
Thursday, February 4, 2021

Android: Send preset SMS with with one tap

›
For all of you that need to sent a simple preset SMS without copy pasting all the time (covid-era). For some reason on the play store most o...
Thursday, May 7, 2020

Java: Return enum instead of boolean

›
We have a game where you place down buildings. So there is always a method that looks like that: public boolean validPlace(BuildingType t...
Thursday, March 5, 2020

C: Autogen headers

›
It is known that I don't like writing header files and forward declarations. The keyword is writing, I like what you can do with header ...
Monday, February 24, 2020

C: Have (more) fun compiling

›
And here we are: ... } else { // TODO print the --help text } ... On ho... where to start... Lets start by making a simple plain tex...
Thursday, February 20, 2020

C: Have fun compiling

›
When I write some small C program I usually put everything in a single main.c file and to compile I just: gcc -O3 main.c -o program_name_...
Tuesday, February 18, 2020

Java: Let's serialize with a map

›
Lets just use a map. So we have a timer like thing: public class Time implements Serializable { private long duration; private lo...
Saturday, January 18, 2020

Android: Lets use android.R.string

›
I was writing a confirm dialog on android, and there was it: android.R.string.yes So lets use it, why not. However my extreme imagin...
Wednesday, October 9, 2019

Java: Optional or just null

›
So I was making a simple game on the weekend, as we do, and there was a simple (again) player class: public class Player { public fin...
Saturday, August 31, 2019

Security: Just remove everything -Boss

›
Let's consider for a fact that we have a very pseudo secure environment. Pseudo referring to something that has been purified of everyth...
Sunday, July 21, 2019

Javascript: Do it like php!

›
So, I just wanted a simple thing... I had a static html page where I wanted to put some things in dynamically: a simple date at the start an...
Thursday, January 10, 2019

Java: Iterable iterator

›
We all have been in a position with an Iterator in our hands and trying to pass it to a for each loop. And then for some reason that is tota...
Wednesday, November 14, 2018

Windows: Uninstalling programs

›
Time to clean up the old windows machine a bit (Linux user here). So I go looking for the good old control panel, but I find the "S...
Friday, September 28, 2018

Regex: Final v

›
This is the most greek a proggrammer can be. Ακολουθεί μία από τις χρήσιμες regex που έχουν γράψει στην ζωή μου. Εντοπίζει λάθος χρήση ...
Thursday, July 26, 2018

Java: enum or boolean for two value properties

›
The is always that tip that floats around that you should always use enums instead of booleans, even when there is only two values. Of co...
Tuesday, May 16, 2017

C++: Euclidean distance variations

›
So how about this new std::hypot? float dx = x1 - x2; float dy = y1 - y2; return std::hypot(dx, dy); Time: 12139783 ticks How ab...
Friday, November 4, 2016

C++: New keyword exceptions

›
When new is used, a bad_alloc can be thrown. To return null pointer on error instead of the exception a second format can be used: Site *m...
Wednesday, October 12, 2016

Windows: Copy only what's new or changed

›
Copy all files (/H /G) and directories (/E) that are either new or changed (/D /Y) xcopy C:\From C:\To /D /E /I /H /Y /G done_
Monday, September 12, 2016

Java: Open link in browser

›
Open a link with the default browser: Desktop.getDesktop().browse(new URL("http://maanoo.com").toURI()); done_
Friday, November 20, 2015

Techniques: Random art with symmetry

›
So lets add many circles together: Thats ok but what if we add some symmetry. Lets add symmetry from one axis: From two axis: ...
Wednesday, November 18, 2015

Javascript: Canvas circles

›
So we always start: var canvas = document.getElementById("canvas"); var c = canvas.getContext("2d"); and we have the...
Monday, November 16, 2015

HTML: Canvas background

›
To have a canvas as a html page background we need: HTML: <body onload="load()"> <canvas id="canvas_back"...
Friday, November 13, 2015

Android: Store values

›
We can save and load values, permanently, using Shared Preferences. The shared preferences framework provides an easy way to store values,...
Wednesday, November 11, 2015

JavaScript: Local and Session storage

›
To store values to a browser we can use localStorage and sessionStorage just by: localStorage["name"] = value; and to get the ...
Monday, November 9, 2015

JavaScript: jQuery selector

›
If we want to use JQuery ONLY for selecting elements like: $(".item") Why use a whole library, just: document.querySelectorA...
Friday, November 6, 2015

PHP: Simple counter

›
A simple counter using a text file. The php code: <?php $path = "./counter.txt"; $count = intval(file_get_contents($pat...
Wednesday, November 4, 2015

CSS: Transition all

›
In CSS if we define transitions, every time a value changes an animation-transition is created and executed. So if we want to use transiti...
Monday, November 2, 2015

Techniques: Base64

›
Base64: make anything to a "simple" text and reverse. Where "simple" means that contains only the 'A'–'Z...
Friday, October 30, 2015

Techniques: Generating colors with HSL and HSV/HSB

›
Some definitions first: HSL: Hue Saturation Lightness HSV: Hue Saturation Value HSB: Hue Saturation Brightness HSL != HSV HSV = HSB (...
Wednesday, October 28, 2015

Code: Normalize overflowing values

›
To normalize values like degrees where the main range is [0, 360) but all other values are accepted too the obvious is: value = value % 36...
Monday, October 26, 2015

Java: Set the Clipboard

›
The easiest way to make the Clipboard contain a string is: public void setClipboard(String text) { Clipboard c = Toolkit.getDefaultTool...
Home
View web version
Powered by Blogger.