Skip to content

Instantly share code, notes, and snippets.

View nevergone's full-sized avatar

Kurucz István nevergone

View GitHub Profile
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active May 4, 2024 07:54
Make Firefox fast again

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])   ['▲','▲','●','●']
@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');
@aik099
aik099 / vimeo-downloader.js
Last active September 4, 2023 13:37 — 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 / 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.
*
@ozin7
ozin7 / Controller.php
Last active March 7, 2024 17:56
Drupal 8: Dependency injection in Service, Controller, Plugin, Deriver.
<?php
/**
* Controller. Implements ContainerInjectionInterface
*/
namespace Drupal\gurei\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\gurei\Service\CompanyService;
use Symfony\Component\DependencyInjection\ContainerInterface;
@rwohleb
rwohleb / custom_util.post_update.php
Created November 20, 2019 04:11
Drupal 8: Convert text field to paragraph
<?php
use Drupal\Core\Utility\UpdateException;
use Drupal\paragraphs\Entity\Paragraph;
/**
* Convert news,blog,event body field to paragraphs.
*/
function custom_util_post_update_convert_newsblogevent_body(&$sandbox) {
Age 6, 7:
- Print their name or any string of their choice.
- Flashing Heart - https://makecode.microbit.org/projects/flashing-heart
- Snowflake - https://makecode.microbit.org/lessons/snowflake-fall
- Smiley - https://makecode.microbit.org/lessons/smiley
- Rock paper scissor basic - https://makecode.microbit.org/projects/rock-paper-scissors
- Banana Orange Keyboard - https://makecode.microbit.org/projects
- Magic 8 ball - https://makecode.microbit.org/lessons/magic-8
- Song: Happy Birthday - https://makecode.microbit.org/lessons/happy-birthday
@chx
chx / Table.php
Created December 6, 2018 21:02
Plain table migration source plugin
<?php
namespace Drupal\sd8_migration\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
/**
* Table source from database.
*
@mistic100
mistic100 / vimeo-downloader.js
Created September 15, 2018 09:01
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>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');