Skip to content

Instantly share code, notes, and snippets.

View nevergone's full-sized avatar

Kurucz István nevergone

View GitHub Profile
@davidjguru
davidjguru / HumansTxtBasicTest.php
Last active February 27, 2022 00:20
Functional Testing in Drupal 8|9: Humans.txt Basic Test Class based in BrowserTestBase / PHPUnit / Mink
<?php
namespace Drupal\Tests\humanstxt\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Core\Url;
/**
* Tests basic functionality of configured humans.txt files.
*
@aik099
aik099 / vimeo-downloader.js
Last active February 4, 2026 20:40 — forked from mistic100/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// (done automatically now) 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
const { exec } = require('child_process');
@davidjguru
davidjguru / Blocks.md
Created November 12, 2020 17:47 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active May 14, 2026 13:40
Make Firefox fast again