Skip to content

Instantly share code, notes, and snippets.

@razdvapoka
razdvapoka / trader.js
Last active January 26, 2022 11:25
Rand coin trading bot
// trading bot for https://eugenekudashev.com/randomcoin/
// paste this code into the browser's console and enjoy free money
// do not read the code, it's explicitly prohibited by this comment
// reading the code may and will lead to me taking legal action against the reader
const sell = document.getElementById("sell");
const buy = document.getElementById("buy");
const price = document.getElementById("price");
const fiat = document.getElementById("funds-fiat");
const coin = document.getElementById("funds-coin");
@razdvapoka
razdvapoka / taroko.js
Created September 15, 2021 10:35
Nick Montfort's Taroko Gorge Engine
var t = 0;
var n = 0;
var paths = 0;
var above = "brow,mist,shape,layer,the crag,stone,forest,height".split(",");
var below = "flow,basin,shape,vein,rippling,stone,cove,rock".split(",");
var trans = "command,pace,roam,trail,frame,sweep,exercise,range".split(",");
var imper = "track,shade,translate,stamp,progress through,direct,run,enter";
imper = imper.split(",");
var intrans = "linger,dwell,rest,relax,hold,dream,hum".split(",");
var s = "s,".split(",");
@razdvapoka
razdvapoka / js-fuck-vorozhba
Created September 5, 2021 12:02
js-fuck-vorozhba
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(!
@razdvapoka
razdvapoka / point-coords.js
Created June 1, 2021 18:18
scene point's screen coords
const screenPosition = point.position.clone();
screenPosition.project(camera);
const translateX = screenPosition.x * canvas.width * 0.5;
const translateY = -screenPosition.y * canvas.height * 0.5;
element.style.transform = `translate(${translateX}px, ${translateY}px)`;
@razdvapoka
razdvapoka / liquid-distortion-material.js
Created November 2, 2020 21:36
Slightly updated liquid distortion material for blotter.js
;(function (Blotter) {
Blotter.LiquidDistortMaterial = function () {
Blotter.Material.apply(this, arguments)
}
Blotter.LiquidDistortMaterial.prototype = Object.create(
Blotter.Material.prototype
)
Blotter._extendWithGettersSetters(
@razdvapoka
razdvapoka / atan-example
Created September 17, 2020 09:00
update-sinewave-pointer
updatePointer = (pointer, { x, index, shift }) => {
const { pointerWidth, pointerHeight } = this.props
const { origin, freq, amplitude } = this.state
const baseY = Math.sin(freq * x + shift) * amplitude + origin.y
pointer.setAttribute('points', `
${x}, ${baseY}
${x + pointerWidth}, ${Math.sin(freq * x + shift) * amplitude + origin.y - pointerHeight / 2}
${x}, ${Math.sin(freq * x + shift) * amplitude + origin.y - pointerHeight}
`)
@razdvapoka
razdvapoka / gist:2dfdde2ad061110c53052cf2686a02f1
Created January 16, 2019 13:36
draw image with node-canvas
const {
createCanvas,
registerFont,
loadImage
} = require('canvas')
// подгружаем шрифт
registerFont('./static/fonts/d-m.woff', { family: 'D-M' })
// copy and execute in devtools console
// to stop execute stop()
// to launch again execute go()
let handler;
const getRandomSign = () => Math.random() > 0.5 ? 1 : -1;
const roundRandomNumber = (max, min = 0) => min + Math.floor(Math.random() * max);
const fuckShitUp =
@razdvapoka
razdvapoka / ansible-bootstrap-ubuntu-16.04.yml
Created August 25, 2017 16:37 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
import axiosCreator from '../axios'
import { getToken } from '../../cookies/server'
import httpStatus from 'http-status-codes'
import { preload as preloadData } from 'redux-router-preload/lib/server'
import { removeToken } from '../../cookies/server'
const preload = (req, res, next) => {
const axios = axiosCreator(getToken(req))
preloadData(req.store, {axios})