Skip to content

Instantly share code, notes, and snippets.

@jason-s
jason-s / README.md
Last active Apr 3, 2021
Wordpress ate my матрёшка hacker code
View README.md

I was looking for a motor website and noticed this suspicious looking JavaScript code:

https://web.archive.org/web/20200705182323/http://www.turnigy.com:80/about-us/

It is apparently a 3-level deep obfuscation of some website redirection that failed, because Wordpress faithfully encoded it rather than inserting directly.

  • hack1.js is the code that appears visually in the webpage.
  • hack2.js is the content of variable VWGMMLIBLQ that gets eval()d in hack1.js
  • hack3.js is the content of variable BPCDLVJEMJ that gets eval()d in hack2.js
  • hack4.js is the content of variable dec that gets executed via (new Function(dec))(); in hack3.js
View test1.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View katex2267-0.12.0.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/contrib/auto-render.min.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
@jason-s
jason-s / scavhunt-20200613.md
Last active Jun 13, 2020
2020 Jun 13 Scavenger Hunt Rules
View scavhunt-20200613.md

Country of Origin

At-home Scavenger Hunt, June 13, 2020

J. Sachs

Version 1.01

@jason-s
jason-s / scavhunt1.md
Last active Jun 13, 2020
Scavenger Hunt Part 1 Rules
View scavhunt1.md

At-Home Scavenger Hunt Rules: Part 1 (General)

J. Sachs, 13 Jun 2020

Version 1.01

Overview

Goal: to submit an entry which scores the most points based on a predetermined scoring procedure as outlined in Part 1 and Part 2.

View polymorph3.py
import jsonschema
import yaml
schema1 = yaml.safe_load("""
title: SCHEMA 1 (foo_node or bar_node)
$ref: '#/definitions/root_node'
$schema: http://json-schema.org/draft-07/schema#
definitions:
bar_node:
additionalProperties: false
@jason-s
jason-s / person_view.enaml
Created Apr 9, 2020
Observing return events in Field objects in enaml
View person_view.enaml
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#------------------------------------------------------------------------------
#
# mods by Jason Sachs
#
@jason-s
jason-s / baseline.tex
Last active Apr 1, 2020
prototype for circuitikz logic gate shapes matching IEEE 91-1984 recommendations, using https://tex.stackexchange.com/a/372996/46076 example as baseline
View baseline.tex
\documentclass{standalone}
\usepackage{circuitikz}
\ctikzset{tripoles/american and port/origin/.initial=0.8}
\ctikzset{tripoles/american and port/inputs/.initial=2}
\ctikzset{tripoles/american nand port/origin/.initial=0.8}
\ctikzset{tripoles/american nand port/inputs/.initial=2}
\ctikzset{tripoles/american nor port/origin/.initial=0.8}
View weirdscrolling.html
<!DOCTYPE html><html><head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.2/katex.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.2/katex.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.2/contrib/auto-render.min.js"></script>
<script type='text/javascript'>
window.addEventListener('DOMContentLoaded',function() {
if (window.location.search != '?nokatex')
{
renderMathInElement(document.body, {delimiters:
[
View qtcompleter5.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# based on
# https://qt.gitorious.org/pyside/pyside-examples/source/060dca8e4b82f301dfb33a7182767eaf8ad3d024:examples/itemviews/simpletreemodel/simpletreemodel.py
############################################################################
##
## Copyright (C) 2005-2005 Trolltech AS. All rights reserved.
##