Skip to content

Instantly share code, notes, and snippets.

View ReallyNotARussianSpy's full-sized avatar

Scott Reed ReallyNotARussianSpy

View GitHub Profile
@ReallyNotARussianSpy
ReallyNotARussianSpy / miles_finch.js
Last active June 20, 2018 20:22
Miles Finch User Script
// ==UserScript==
// @name Miles Finch
// @namespace https://dynamiccatholic.com/
// @version 1.0
// @description try to take over the world!
// @author You
// @include *
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @updateURL https://gist.githubusercontent.com/AdJesumPerMariam/60448ae9d16c7268e83bdcac97c3f16b/raw/miles_finch.js
@ReallyNotARussianSpy
ReallyNotARussianSpy / isTokenValid.php
Created June 5, 2018 19:14
PHP function to be used in Magento in conjunction with Cloudflare Workers to determine if a client's CSRF token is valid
<?php
/**
* Returns whether the given CSRF token is valid
*
* @param string $token The CSRF token given by the client
*
* @author Scott Reed <adjesumpermariam1208@gmail.com>
* @return boolean
*/
@ReallyNotARussianSpy
ReallyNotARussianSpy / newrelic_error_monitor.php
Last active December 15, 2017 14:16
Basic script to monitor /var/log/nginx/error.log and insert entries into New Relic
<?php
/*
Monitor /var/log/nginx/error.log and insert entries into New Relic
Place in cron to run every minute
This script matches the following error.log format:
2017/12/15 03:35:11 [error] 64972#64972: *12659427 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: dynamiccatholic.com, request: "POST / HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "dynamiccatholic.com", referrer: "https://dynamiccatholic.com/"
<scott.reed@dynamiccatholic.com> - 11/28/17