This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// | |
// PHP REPL with initialized Magento environment | |
// | |
// Thanks to https://github.com/d11wtq/boris | |
// | |
// Drop this script in your $PATH and run it anywhere in a Magento directory tree to start the REPL | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// PHP REPL with initialized Prestashop environment | |
// | |
// Inspired by https://gist.github.com/Vinai/5579309 | |
// | |
$configFile = '../config/config.inc.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xadC78F169718ED920f1C7d1Cf364D280876Dc715 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This snippet hides all watched videos from the subscriptions list | |
let nodes = document.querySelectorAll('ytd-thumbnail-overlay-playback-status-renderer'); | |
[].map.call(nodes, (el) => { | |
el.parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute('hidden', true); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"reflect" | |
"sort" | |
"testing" | |
) | |
type item struct { | |
from int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy(r.records.reduce((a, row) => { | |
let line = [ | |
row['name'] + '.', | |
row['ttl'], | |
'IN', | |
row['type'], | |
'"' + row['data'] + '"', | |
].join("\t"); | |
a.push(line); | |
return a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy(Array.prototype.slice.call(document.querySelectorAll("a")) | |
.filter(link => link.text && !link.href.startsWith(window.location.href.substr(0, 10))) | |
.map(link => `${link.href}\t${link.text}`) | |
.join("\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<style> | |
.main { | |
display: flex; | |
flex-direction: column; | |
} | |
#preview { | |
margin-top: 1em; | |
white-space: pre; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
INPUT=$(realpath "$1") | |
INPUT_PATH=$(dirname "$INPUT") | |
TMP_DIR=$(mktemp -d -t tar-extract-XXXXX) | |
SRC_TMP_DIR="$TMP_DIR/in" | |
DST_TMP_DIR="$TMP_DIR/out" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
var container = document.createElement('div'); | |
container.setAttribute('style', 'position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9999'); | |
var textarea = document.createElement('textarea'); | |
textarea.setAttribute('style', 'width:99%; height: 20em'); | |
var close = document.createElement('button'); | |
close.textContent = 'Close' | |
close.addEventListener("click", function() { |