Skip to content

Instantly share code, notes, and snippets.

View subzey's full-sized avatar

Anton Khlynovskiy subzey

View GitHub Profile
@subzey
subzey / index.html
Last active June 18, 2018 12:19
Self-replacement scripts
<!doctype html>
<html>
<body>
<p>Local resolve (<code>selfreplacement.js</code>): <script async defer src="selfreplacement.js">#1: OKAY</script>
<p>Local resolve (<code>./selfreplacement.js</code>): <script async defer src="./selfreplacement.js">#2: OKAY</script>
<p>bl.ocks full: <script async defer src="https://bl.ocks.org/subzey/raw/ccd85c8c424120350157a5a4a3b9c47d/selfreplacement.js">#3: OKAY</script>
<p>bl.ocks protocol-relative: <script async defer src="//bl.ocks.org/subzey/raw/ccd85c8c424120350157a5a4a3b9c47d/selfreplacement.js">#4: OKAY</script>
<p>rawgit full: <script async defer src="https://rawgit.com/subzey/ccd85c8c424120350157a5a4a3b9c47d/raw/selfreplacement.js">#5: OKAY</script>
@subzey
subzey / index.html
Created June 25, 2018 17:11
jq 1.7 cache leak
<!doctype html>
<html>
<head>
<title>jQuery 1.7.2 cache leak</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-1.7.2.min.js" crossorigin="anonymous"></script>
<script>
(function(){
var leaky = new function Leaky(){};
@subzey
subzey / main.py
Created August 1, 2018 15:12
Precompressed header
import BaseHTTPServer
import io
import random
import time
import zlib
HOST_NAME = 'localhost'
PORT_NUMBER = 8080
gzip = zlib.compressobj(
@subzey
subzey / some js
Last active October 5, 2018 08:15
import t from 'some-fancy-templater';
t`
<div class="container">
<h1>Ponies</h1>
<${PonyList}>
${ ponies.map(
({ name, type }) => t`
<${PonyItem} name="${name}" type="{type}"/>
`
@subzey
subzey / index.html
Created January 31, 2019 13:29
Resize debug
<!DOCTYPE html>
<html>
<head>
<title>Screen size debug</title>
</head>
<body>
<script>
function log(s){
var logEntry = document.createElement('pre');
logEntry.textContent = (new Date().toISOString() + ' ' + s);
@subzey
subzey / filter.svg
Last active February 26, 2020 17:55
SVG retrowave filter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@subzey
subzey / index.html
Last active April 8, 2019 19:04
glitchy logo
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
font: 16pt sans-serif;
text-align: center;
}
</style>
@subzey
subzey / sad.css
Last active April 12, 2019 15:26
sad unicorn bg
@-moz-document url-prefix("https://jira.xtools.tv") {
.ghx-swimlane.ghx-first .ghx-column[data-column-id="554"]:empty {
background-image: url(https://s.tcdn.co/c5f/0a5/c5f0a53d-cec7-36d8-be42-c2e1bf5baf97/13.png);
background-size: contain;
background-position: 50% 20%;
background-repeat: no-repeat;
}
}
.ghx-swimlane.ghx-first .ghx-column[data-column-id="554"]:empty {
background: none;
}
.ghx-swimlane.ghx-first .ghx-column[data-column-id="554"]:empty:before {
content: '';
display: block;
position: sticky;
z-index: 2;
top: 100%;
@subzey
subzey / index.html
Last active July 30, 2025 16:19
Emoji roulette
<!DOCTYPE html>
<html>
<head>
<title>СПГС 2023</title>
<style>
html {
height: 100%;
background: radial-gradient(#fff, #f0f0f0 50%, #aaa) #eee;
}
body {