Skip to content

Instantly share code, notes, and snippets.

View szepeviktor's full-sized avatar
🍓
Making applications error-free

Viktor Szépe szepeviktor

🍓
Making applications error-free
View GitHub Profile
<?php
class SecureJSON
{
public $array;
public $key;
public function __construct(array $array)
{
@szepeviktor
szepeviktor / google-search-ads-old-style.js
Last active August 21, 2020 07:45
Google Search ads old green style
// ==UserScript==
// @name Google Search old green ads
// @description Mark ads with green "Ad" tag
// @author https://gist.github.com/szepeviktor/83f8f1f12a10fb17bc222710d50b4452
// @icon https://www.google.com/favicon.ico
// @version 0.7.0
// @grant none
// @run-at document-idle
// @include https://www.google.*/search?*
// ==/UserScript==
javascript:(function(){ const outline = document.querySelector('.outline-everything-with-red'); if(!outline){ style = document.createElement('style'); style.classList.add('outline-everything-with-red'); style.appendChild(document.createTextNode('* {outline: 1px solid red;}')); document.head.appendChild(style); console.log('The following elements appear to be wider than the document.'); [].forEach.call( document.querySelectorAll('*'), function(el) { if (el.offsetWidth > docWidth) { console.log(el); } } ); } else{ outline.remove(); } var docWidth = document.documentElement.offsetWidth; })()
@ricealexander
ricealexander / emoji-list.md
Last active March 31, 2025 18:44 — forked from rxaviers/gist:7360908
Comprehensive list of GitHub-supported emojis
@leagris
leagris / which-min.sh
Last active March 27, 2022 22:25
Bash implementation of debianutils:which
#!/usr/bin/env bash
IFS=:;if (($#>0))&&[ "${1:0:1}" == - ];then if [ "$1" != -a ];then printf >&2 'Illegal option %s\nUsage: which [-a] args\n' "$1";exit 2;else b=1;fi;shift;fi;read -rd '' -a g < <(printf %s:\\0 "$PATH");while (($# > 0));do f=0;for d in "${g[@]}";do e="$d/$1";while [[ -L $e && "$(ls -l "$e")" =~ -\>\ (.*) ]];do e="${BASH_REMATCH[1]}";done;if [[ -f $e && -x $e ]];then f=1;echo "$d/$1";((b))||break;fi;done;((f))||c=1;shift;done;exit $c
@tomjn
tomjn / tomjn_http2_push.php
Created January 25, 2019 23:43
A naive and incomplete, but functional approach to http2 push
<?php
/**
* Plugin name: HTTP2 Push scripts
* Author: Tom J Nowell
*/
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) {
global $wp_version;
$relative = str_replace( site_url(), '', $dep->src );
$ver = $dep->ver;
@szepeviktor
szepeviktor / script-loader.js
Last active April 23, 2020 20:25
Mini JavaScript loader
<script id="in-head">
/*jslint
browser:true
*/
/**
* Load a script in an asynchronous manner.
* @param {string} uri
* @param {callback} loadCallback
* @param {callback} errorCallback
@szepeviktor
szepeviktor / netpincer-boldogora.sh
Created August 28, 2018 19:32
Slack üzenetet küld, ha egy új étteremnek van Boldog Órája a Netpincéren
#!/bin/bash
#
# Send notification on new Netpincér Boldog Óra restaurants.
#
# DEPENDS :pip3 install slack-webhook-cli
# Boldog Óra page
NETPINCER_BOLDOGORA="https://www.netpincer.hu/budapest_iii/hazhozszallitas/happy/1"
# Cache file
NETPINCER_BOLDOGORA_CACHE="${HOME}/.cache/netpincer-boldogora"

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@szepeviktor
szepeviktor / keybase.md
Created March 19, 2018 14:08
keybase.md

Keybase proof

I hereby claim:

  • I am szepeviktor on github.
  • I am szepeviktor (https://keybase.io/szepeviktor) on keybase.
  • I have a public key whose fingerprint is 4DEC 831C 798C E179 6E7F F981 40DF 3C97 B9CD C292

To claim this, I am signing this object: