Skip to content

Instantly share code, notes, and snippets.

View cycle20's full-sized avatar

Csongor T. G. cycle20

View GitHub Profile
@cycle20
cycle20 / watch.php
Created August 30, 2023 14:21
inotify handler
<?php
$fd = inotify_init();
$file = '../<your-directory-path>';
$cmd = 'npm run build';
$watchDescriptor = inotify_add_watch($fd, $file, IN_MODIFY);
while (true) {
$alreadyRun = false;
$events = inotify_read($fd);
@cycle20
cycle20 / jekyll_customization.md
Last active February 8, 2022 19:30
Jekyll template customization

'minima' customization

  • bundle exec jekyll serve --watch
  • bundle info minima - to get the minima gem location
  • tree <minima-path>
  • cp -r <minima-path>/_sass _sass # copy the file or subset of file for local modification
  • diff <minima-path>/_sass/minima.scss _sass/minima.scss:
13c13
&lt; $text-color: #111 !default;
@cycle20
cycle20 / duplicate.bash
Last active January 17, 2022 07:11
Search tool to identify duplicated files
# duplicate.bash:
# Search tool to identify duplicated files.
#
# Usage: bash duplicate.bash | sort > search_results.txt
# if called as child process, do the job
if [ "$1" = "CHILD" ]; then
# drop the CHILD argument
shift
@cycle20
cycle20 / camelcase_to_snakecase.bash
Last active July 4, 2021 21:38
pick names with underscore from mysql schema file
# camelcase_to_snakecase.bash:
#
# Generates sed script from snakecase names.
# The generated script contains substitution
# sed commands to replace camelcase names to
# snakecase style in source codes.
#
# Script reading snakecase names from its std. input.
echo "reading/expecting snakecase names from standard input" \
@cycle20
cycle20 / collection_of_opinions.md
Last active June 18, 2021 15:50
"Bullsh*t" jobs...

Poll on HUP

https://hup.hu/szavazasok/20210617/na_b_ma_se_csinaltam_semmi_hasznosat

Neg comment

Akkor becsüld meg, mert ahány külföldi multi magyar lerakatáról belsős infó van, mind az van amit fentebb többen is írnak.

Felvesznek top-top-top techikai(nak beállított!) beosztásba, azaz NEM menedzsernek. Valóságban meg szakma jó ha 5% v. max 10%-a lesz a munkaidődnek. Maradék 90% az arra megy el, h. adminisztrálod 4-5 különböző webes szarba, rosszabb esetben 4-5 ekszelbe h. micsináltál ma. Majd ugyanezt az 5-6 felettesednek szóban is reportálod (szigorúan külön-külön) h. miért nem haladtál ma se semmire a tényleges munkáddal mert a nekik reportálással baszod el az idődet. Utana meg az üfféllel mítingben is ugyanezt előadni 10-20 emberrel közösen. >

@cycle20
cycle20 / enzo-2021-06-09.md
Last active June 9, 2021 12:15
'enzo' NOTEs (2021-06-09)

Command collections

PHP : composer
php8 composer.phar diagnose
php8 composer.phar check-platform-reqs
php8 composer.phar config -l
php8 composer.phar show
@cycle20
cycle20 / mysql_perf_statuses_variables.md
Last active June 8, 2021 07:51
to collect debug info
  • show engine innodb status; - You can monitor adaptive hash index use and contention in the SEMAPHORES section of SHOW ENGINE INNODB STATUS output. If there are numerous threads waiting on rw-latches created in btr0sea.c, consider increasing the number of adaptive hash index partitions or disabling the adaptive hash index.
  • show engine innodb mutex;
  • https://dev.mysql.com/doc/refman/8.0/en/innodb-adaptive-hash.html
@cycle20
cycle20 / spreadSheet.R
Created May 10, 2021 10:19
GoogleSheet auth and read example
# NOTE: this is as simple as possible
# minimum effort to demonstrate the steps
googlesheets4::gs4_auth(
path = "~/.config/<your protected folder>/<your very secret toke file of your service account>.json"
scopes = "https://www.googleapis.com/auth/spreadsheets.readonly"
)
SPREADSHEET.ID <- Sys.getenv("SPREADSHEET_ID")
spreadSheet <- googlesheets4::read_sheet(SPREADSHEET.ID)
# question: https://stackoverflow.com/q/59675618/10393390
# answer: rsync should solve it...
# usage:
# bash rsync_way.bash
mkdir SANDBOX
cd SANDBOX
function just_do_it() {