Skip to content

Instantly share code, notes, and snippets.

View aquilax's full-sized avatar
💭
Fighting entropy

Evgeniy Vasilev aquilax

💭
Fighting entropy
View GitHub Profile
@aquilax
aquilax / boris-mage.php
Created December 22, 2015 14:35 — forked from Vinai/boris-mage.php
PHP REPL with initialized Magento environment
#!/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
//
@aquilax
aquilax / shell.php
Created January 14, 2016 12:13
PrestaShop REPL
<?php
//
// PHP REPL with initialized Prestashop environment
//
// Inspired by https://gist.github.com/Vinai/5579309
//
$configFile = '../config/config.inc.php';
0xadC78F169718ED920f1C7d1Cf364D280876Dc715
@aquilax
aquilax / youtube_hide.js
Created October 28, 2017 18:00
This snippet hides all watched videos from the subscriptions list
// 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);
});
package main
import (
"reflect"
"sort"
"testing"
)
type item struct {
from int
@aquilax
aquilax / rackspace-dns-to-bind.js
Created August 19, 2018 05:13
Rough Rackspace DNS to bind translator
copy(r.records.reduce((a, row) => {
let line = [
row['name'] + '.',
row['ttl'],
'IN',
row['type'],
'"' + row['data'] + '"',
].join("\t");
a.push(line);
return a;
@aquilax
aquilax / metafilter_playlist.js
Created December 2, 2018 05:23
Copy external links from a thread as tab delimited table
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"));
@aquilax
aquilax / index.html
Last active January 17, 2021 13:25
zadachko
<!DOCTYPE html>
<head>
<style>
.main {
display: flex;
flex-direction: column;
}
#preview {
margin-top: 1em;
white-space: pre;
#!/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"
@aquilax
aquilax / bookmarklet_raw.js
Last active May 15, 2021 08:49
Sort lines bookmarklet
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() {