Skip to content

Instantly share code, notes, and snippets.

Working from home

ǃшɒʞɒH ǃǀɄ abilogos

Working from home
View GitHub Profile
abilogos / detect-zoom.js
Created Nov 24, 2019
Getting browser Zoom level
View detect-zoom.js
//for zoom detection
px_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
function isZooming(){
var newPx_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
if(newPx_ratio != px_ratio){
px_ratio = newPx_ratio;
abilogos /
Created Mar 14, 2020
Android Java Development in case of Using an Layout Element that hasnot text attribute, a string can convert to an bitmap
//method to convert your text to image
public static Bitmap textAsBitmap(String text, float textSize, int textColor) {
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
float baseline = -paint.ascent(); // ascent() is negative
int width = (int) (paint.measureText(text) + 0.0f); // round
int height = (int) (baseline + paint.descent() + 0.0f);
Bitmap image = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
abilogos / isikukood.php
Last active Apr 13, 2020
Validate Estonian National code
View isikukood.php
* Validate Estonian national identification code.
* Copyright (c) 2020 Ali Hakami
* port from @author Mika Tuupola (javascript)
* Licensed under the MIT license:
abilogos / multiline_string_template.js
Last active Feb 13, 2021
A Template to have Multiline String without appending strings
View multiline_string_template.js
//its a js hack for having multiline string like python`s ''' multi line '''
var html = (function () {/*
multiline with
white spaces
and newlines