Skip to content

Instantly share code, notes, and snippets.

View konsalex's full-sized avatar
👨‍🔬
Building Graph-ical Interfaces

Costa Alexoglou konsalex

👨‍🔬
Building Graph-ical Interfaces
View GitHub Profile
@bahadiraraz
bahadiraraz / Git_Commit_Freeze_Solution.md
Last active June 24, 2025 15:44
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.

@konsalex
konsalex / slackFavicon.js
Created April 29, 2022 09:12
Slack Notification Favicon removal 😌
// The default "no notifications" icon of Slack on web
const simpleFavicon =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAFyklEQVR4nO2bPXMTVxiFz3tlyySFspqBTCiAVefGQi7CDAFnrBYmweoIjfUPLHcUEEuBIl3kX4BVBNNJDhmczkqRDzCFMBR0XgwzyWTMeCEzmcH27kkhY4y1kvZaV/5I/My4uffq7LtntOu7Z18JDJOaW7H7+tQYyWEAFgUOfc6sr6FSS8edMBr9s1ftKKKj8P0RiFgEHAFmVt+sVZ5mvg2lERYxKXbml1cTAPNNph0RTt7/LF5spZH86esx+Gy2xgVQWLhwo6WGDsYMaHPy71Aq++BsrBQ0lZy9NgFKew1g3JQJRgxIza3Y0agshlzurq4yUUvH3a2D/bNX7Sh7Q2uoN38napmi23ZlG1SnAgDQF1UTGsutvl5ktw/2oldLw4/Gchrrm2LEAJIprfWC4e1j4ouWBpTeMZvKmBCBIKWznCIfNWponhBxWmt9E8wYADiGdHYdIwYIUDOhsxcYMcDzOWlCZy8wYsDDoXiVB9QEU/cAzA/FcwfRBGMGABsmgIMgSyBqqN8cG/6kvqXdF/SYFpw/F68BjRud/YrRb8BB5NCAvS5gr3nvHpCaW7GjR9QoyBSot71tgkuBC7K0topq2EDEBHY5Z8WOxMZIpoS0KeIGhSqbj8Of/vpqTNg0iDCBA4/jDz6PV4Imk/euU1dv4cKNRKBWPVTJA7ACpl1sCVUUUA8zunzyAGAjIuUzv70e7eZBkrPXJjYSJavJEgvAd8l713MAoFJzK3aoJMcUvl9Mza1Y3ZDun71qh0yUAGAiVc5ZSjPMMEFgIGKCnYQqygdHulFMK4ICERPsJFRR0vxa6RqBgYi+itswJLT0JHBacf/syx2dxYS4nR6QgKMUdz/MUD5nAsr5WUdDyE
@adam-cowley
adam-cowley / all.cypher
Last active June 11, 2021 10:15
Euro 2020 in Neo4j
:begin
CREATE INDEX ON :Fixture(kickoff);
CREATE CONSTRAINT ON (node:Country) ASSERT (node.id) IS UNIQUE;
CREATE CONSTRAINT ON (node:Fixture) ASSERT (node.id) IS UNIQUE;
CREATE CONSTRAINT ON (node:Group) ASSERT (node.id) IS UNIQUE;
CREATE CONSTRAINT ON (node:Player) ASSERT (node.id) IS UNIQUE;
CREATE CONSTRAINT ON (node:Stadium) ASSERT (node.name) IS UNIQUE;
CREATE CONSTRAINT ON (node:`UNIQUE IMPORT LABEL`) ASSERT (node.`UNIQUE IMPORT ID`) IS UNIQUE;
:commit
CALL db.awaitIndexes(300);
@konsalex
konsalex / fullPageScreenshot.js
Created January 14, 2020 11:38
Puppeteer Full page Screenshot Workaround
function addStyleString(str) {
var node = document.createElement("style");
node.innerHTML = str;
document.body.appendChild(node);
}
const viewportWidth = window.innerWidth;
const viewportHeight = window.innerHeight;
const new_vh = 0.01 * viewportHeight;
const new_vw = 0.01 * viewportWidth;
@bebosudo
bebosudo / django_custom_widget.md
Last active January 25, 2024 02:48
Custom django form widget with no pain.

First of all, edit your_app_settings/settings.py and add:

INSTALLED_APPS = [
    'django.forms',  # to let django discover the built-in widgets
    ...
]

FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
@giannisp
giannisp / gist:1d8dc9a6ed13876c51ccfe9fefcb311e
Created January 13, 2017 09:50
Using lodash from Chrome's dev tools console
# How to make lodash available via "_" on console
var el = document.createElement('script');
el.src = 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js';
document.getElementsByTagName('head')[0].appendChild(el);
# Use _.VERSION or any other function to verify that it worked
# lodash 4.x version quick link:
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.js
@wojteklu
wojteklu / clean_code.md
Last active July 2, 2025 13:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@myouju
myouju / enc_dec.go
Last active April 29, 2024 09:42
encryption - encrypt / decrypt by ruby, python, and golang with AES-256-CFB
package main
import (
"fmt"
"io"
"encoding/base64"
"crypto/rand"
"crypto/cipher"
"crypto/aes"
"crypto/md5"
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@cuth
cuth / debug-scroll.md
Last active October 18, 2024 08:22
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right > w || b.left < 0) {