Skip to content

Instantly share code, notes, and snippets.

@johnss
johnss / index.html
Created December 31, 2022 20:52 — forked from Cyclenerd/index.html
Static (with no PHP or other server-side scripting) Speedtest
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Speedtest</title>
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="favicon.ico">
<script src="speedtest.js"></script>
<script>
function I(i){return document.getElementById(i);}
@johnss
johnss / erc20token.sol
Created October 21, 2022 12:34 — forked from victorleejw/erc20token.sol
Erc20 Smart Contract for a Standard, Capped, Mintable, Burnable, Payable Token.
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
// https://ropsten.etherscan.io/address/0x8df55a60a1c98281a60d6c89f59398bee854fbc8#code
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@johnss
johnss / proxy.php
Created October 11, 2019 13:45 — forked from FenrirUnbound/proxy.php
A simple proxy redirect
<?php
// PHP Proxy
// Responds to both HTTP GET and POST requests
//
// Author: Abdul Qabiz
// March 31st, 2006
//
// Get the url of to be proxied
// Is it a POST or a GET?
@johnss
johnss / gist:1ba9bf64827aff1452e704cb36851cf0
Created June 5, 2019 09:57 — forked from lopugit/gist:14f28b7e4db8225fcff32b990c19a2bb
Delete large file from github history when dealing with remote rejected pre-receive hook declined Large files detected this exceeds GitHub's file size limit
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
@johnss
johnss / ffmpeg.sh
Created May 23, 2019 15:43
Convert GIF to MP4 HQ or lossless
ffmpeg -i /file.gif -pix_fmt yuv420p /file.mp4
@johnss
johnss / functions.php
Created April 19, 2019 15:42
Wordpress Embed Add Openload
<?php
function wp_embed_handler_openload($matches, $attr, $url, $rawattr)
{
$embed = sprintf(
'<iframe src="https://openload.co/embed/%s" scrolling="no" frameborder="0" width="700" height="430" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">></iframe>',
esc_attr($matches[1])
@johnss
johnss / webm2mkv.sh
Last active December 23, 2018 20:19
WEBM to MKV copy codec (original quality)
ffmpeg -i /name-of-the-video.webm -c copy /name-of-the-video.mkv
@johnss
johnss / lunr_save.js
Created April 6, 2018 09:00 — forked from Fil/lunr_save.js
save lunr.js state
/*
* Paste this is the console to get an indexed JSON
*/
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
@johnss
johnss / online.php
Created December 16, 2017 15:46
Online counter using session_save_path()
<?php
define("MAX_IDLE_TIME", 3);
class online{
function who(){
$path = session_save_path();
if (trim($path)=="") {
return FALSE;
@johnss
johnss / source.js
Created September 20, 2017 18:00
Javascript Source Viewer
var n=document.firstChild;while(n && n.nodeType!=Node.ELEMENT_NODE) n=n.nextSibling;document.write('<pre>' + n.outerHTML.replace(/&/g, '&amp;').replace(/</g, '<font color=\'#aa6600\'>&lt;').replace(/>/g, '&gt;</font>'));