Skip to content

Instantly share code, notes, and snippets.

View nevergone's full-sized avatar

Kurucz István nevergone

View GitHub Profile
@nevergone
nevergone / comment_child_count.sql
Last active February 17, 2023 07:23
Posts with the most one-level children comments (Drupal 8-10)
Without Subselect:
SELECT count(child.cid), parent.cid, user.uid, user.name, node_field.nid, node_field.title
FROM comment_field_data as parent
LEFT JOIN comment_field_data AS child ON parent.cid = child.pid
INNER JOIN users_field_data as user ON parent.uid=user.uid
INNER JOIN node_field_data as node_field ON parent.entity_id=node_field.nid
GROUP BY parent.cid
ORDER BY COUNT(child.cid) DESC;
@nevergone
nevergone / git_aliases.txt
Created October 4, 2022 18:39
git aliases
never@t470-never-20:38-~$ git aliases
ci=commit
cia=commit -a
ciam=commit --amend
stl=stash list
stp=stash pop
sts=stash save
stsu=stash save -u
stsp=stash show -p
subin=submodule init
http://example.com/foobar/http://example.com/foobar/
@nevergone
nevergone / microbit - fénysorompó.py
Last active January 9, 2022 12:55
Fénysorompó készítése Micro:bit platformon
def elo_tilos_jelzes_utasitasok():
pins.digital_write_pin(DigitalPin.P0, 0)
def on_button_pressed_a():
global szabad
while foglalt:
basic.pause(100)
if szabad:
szabad = False
elo_tilos_jelzes_utasitasok()
@nevergone
nevergone / docker-compose.yml
Last active December 7, 2021 13:04
Docker compose with docker:dind
x-volumes:
&x-volumes
volumes:
- ./docker-repo:/var/lib/docker
- ./project:/app
services:
docker:
# Starts a Docker daemon at the DNS name "docker"
# Note:
@nevergone
nevergone / sed.txt
Created June 12, 2021 22:40
sed regex with line insert
sed -i -re '/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com(.*)/a \1' sources.list
@nevergone
nevergone / Javascript Array methods.md
Created May 31, 2021 09:53
Comprehensive quick reference for Array methods

Comprehensive quick reference for Array methods

[,,,].map(  )  [,,,]

[,,,].filter(  true)  [,]

[,,,].find(  true)  

[,,,].findIndex(  true)  3
@nevergone
nevergone / DRUSH_OPTIONS_URI__variable.patch
Created October 24, 2020 10:32
Drush 4.x - DRUSH_OPTIONS_URI__variable.patch
diff --git a/commands/core/drupal/site_install_6.inc b/commands/core/drupal/site_install_6.inc
index 21424fb9b..d88110b54 100644
--- a/commands/core/drupal/site_install_6.inc
+++ b/commands/core/drupal/site_install_6.inc
@@ -18,7 +18,7 @@ function drush_core_site_install_version($profile) {
$cli_output = drush_shell_exec_output();
$cli_cookie = end($cli_output);
- // We need to bootstrap the database to be able to check the progress of the
+ // We need to bootstrap the database to be able to check the progress of the
@nevergone
nevergone / DRUSH_OPTIONS_URI__variable.patch
Created October 24, 2020 10:31
Drush 7.x - DRUSH_OPTIONS_URI__variable.patch
diff --git a/includes/preflight.inc b/includes/preflight.inc
index e0812372c..de3646dc2 100644
--- a/includes/preflight.inc
+++ b/includes/preflight.inc
@@ -394,6 +394,9 @@ function _drush_preflight_root_uri() {
*/
function _drush_preflight_uri() {
$uri = drush_get_option('uri', '');
+ if (empty($uri) && getenv('DRUSH_OPTIONS_URI')) {
+ $uri = getenv('DRUSH_OPTIONS_URI');
<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="StravaGPX Android" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1">
<metadata>
<time>2020-03-03T09:01:56Z</time>
</metadata>
<trk>
<name>Morning Walk</name>
<type>10</type>
<trkseg>
<trkpt lat="48.0052760" lon="21.7257150">