Skip to content

Instantly share code, notes, and snippets.

View 57u's full-sized avatar

Stuart 57u

View GitHub Profile
pragma solidity >=0.5.0;
interface IBakerySwapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
# Add a bookmark to your bar, pop this JS one-liner in the URL field.
# Click it when you need to make a light site into a dark-mode one.
# Give your eyes a break :)
javascript:!function(){let e="html {-webkit-filter: invert(100%);-moz-filter: invert(100%);-o-filter: invert(100%);-ms-filter: invert(100%); }",t=document.getElementsByTagName("head")[0],i=document.createElement("style");window.counter?(window.counter++,window.counter%2==0&&(e="html { -webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }")):window.counter=1,i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i)}();
# Formatted, there is no bad intent
@57u
57u / create_json_extract.sql
Created April 27, 2021 15:33 — forked from serkanalgur/create_json_extract.sql
json_extract and json_unquote creator functions for Mysql < 5.7 . If you use translatable texts with Laravel you can use this. (I was forced to use Laravel with cPanel built with MySQL 5.6)
DELIMITER $$
CREATE FUNCTION `json_extract`(`details` TEXT, `required_field` VARCHAR(255)) RETURNS text CHARSET utf8mb4
BEGIN
RETURN TRIM(
BOTH '"' FROM SUBSTRING_INDEX(
SUBSTRING_INDEX(
SUBSTRING_INDEX(
details,
CONCAT(
'"',
@57u
57u / simple-pagination.js
Created May 21, 2018 15:24 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@57u
57u / SimpleStore.js
Created August 31, 2017 09:36 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@57u
57u / dom-to-json.js
Created March 27, 2017 10:31 — forked from sstur/dom-to-json.js
Stringify DOM nodes using JSON (and revive again)
function toJSON(node) {
node = node || this;
var obj = {
nodeType: node.nodeType
};
if (node.tagName) {
obj.tagName = node.tagName.toLowerCase();
} else
if (node.nodeName) {
obj.nodeName = node.nodeName;
@57u
57u / gist:d374d6f86ceb4a32483fc2e87582d9bd
Created November 8, 2016 16:16 — forked from j3j5/gist:8b3e48ccad746b90a54a
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
@57u
57u / GAME_DATA_MOVES.json
Created July 27, 2016 17:51 — forked from rmkane/GAME_DATA_HISTORY.json
Pokemon GO - Game Data Statistics
[ {
"ID": 13,
"Name": "Wrap",
"Move Type": "Charge",
"Animation ID": 5,
"Type": "Normal",
"Power": 15,
"Accuracy Chance": 1,
"Stamina Loss Scalar": 0.06,
"Trainer Level Min": 1,
@57u
57u / gist:fc7a210348172956a78d
Created November 12, 2015 17:13 — forked from perploug/gist:7334403
how to hook into tree menus in V7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Core;
namespace Meh.App_Code
{
public class ChangeMenu : ApplicationEventHandler
{
@57u
57u / frontendDevlopmentBookmarks.md
Created November 5, 2015 15:30 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.