Skip to content

Instantly share code, notes, and snippets.

View slattery's full-sized avatar

Mike Slattery slattery

View GitHub Profile
@Sarverott
Sarverott / #youtube-get-list-of-videos-from-playing-playlist-easy.js
Last active January 19, 2022 00:27
paste code into browser devtools js console (F12 in most of internet browsers, search for "CONSOLE") and press enter to get playlist videos, list of tracks should be printed below. 3 variants of code: EASY, EXTRA and SHORTEST
/* Sett Sarverott @ 2021 */
var d="YT-playlist.";
var pl="";
var z=window.location.href.split("?")[1].split("&");
for(var i in z)
if(
z[i].split("=")[0]=="list"
)
pl=z[i].split("=")[1];
d+=pl+".txt\n\n~~~~~~\n";
@megclaypool
megclaypool / howto.md
Last active August 30, 2024 12:48
[How to unset an element in an array in twig]
@avinashgardas
avinashgardas / index.js
Created May 16, 2021 19:18
Fetch YouTube playlists with all playlist-items from a YouTube channel in NodeJS
const express = require("express");
const { getData } = require("./youtube/youtube-channel-videos-with-playlist");
const router = express.Router();
router.get("/youtube/playlists", getData);
module.exports = router;
@PeterDing
PeterDing / index.html
Created February 6, 2021 03:34
Plyr Playlist V5 - Previous - Next
<div class="container">
<div id="player">
<div class="js-player" data-type="youtube" data-video-id="" data-ytpls="PL533213361AEB44D3"></div>
<!-- <div class="plyr-playlist-wrapper"><ul class="plyr-playlist"></ul></div> RDxdYFuCp3m9k-->
</div>
<!-- <ul id="playlist"></ul> -->
</div>
@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');
@mTrax-
mTrax- / docker-compose.yml
Created October 13, 2019 19:50
Traefik v2 with ssl
version: "3.3"
services:
reverse-proxy:
image: traefik:latest
restart: unless-stopped
command:
- --api
- --providers.docker=true
- --entrypoints.web.address=:80
@dianaow
dianaow / .block
Last active April 5, 2019 22:51
Vega-lite: Stacked bar chart of US Army Infantry Casualties of Vietnam War
license: mit
@jcheng5
jcheng5 / gist:1ff1efbc539542ecedde92f25458a872
Created June 8, 2018 23:36
Cancellable tasks (without async)
base_task_iterator <- function(should_continue, iter_body) {
if (should_continue()) {
iter_body()
later::later(~base_task_iterator(should_continue, iter_body))
}
invisible()
}
while_task_iterator <- function(cancelExpr, whileExpr, func) {
@adamkl
adamkl / regen-domain-types.js
Last active September 28, 2022 15:04
Generating typescript definitions from .graphql files using apollo-codegen and graphql-code-generator
const { introspectSchema } = require("apollo-codegen");
const { executeWithOptions } = require("graphql-code-generator/dist/cli");
const fs = require("fs");
const path = require("path");
const graphqlPath = "./src/graphql/";
const schemaInput = "./src/graphql/temp.graphql";
const jsonOutput = "./src/graphql/temp.json";
const dtsOutput = "./src/graphql/domain.d.ts";
@kuchibs
kuchibs / OpenshiftOrigin.md
Last active September 11, 2019 09:11
Use Ansible to install Openshift Origin (oc) single node cluster on number of machines!

Install OpenShift Origin on one node (CENTOS) - commands:

1) Install docker

yum install docker -y 
systemctl start docker

Note:

echo "INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'" >> /etc/sysconfig/docker
systemctl enable docker