Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🛩 Running your application

Viktor Szépe szepeviktor

💭
🛩 Running your application
View GitHub Profile
@szepeviktor
szepeviktor / marseus-hp.sh
Last active Jul 20, 2020
Marseus.hu HP WorkStation figyelő
View marseus-hp.sh
#!/bin/bash
EXPECTED_HASH=1c9f2c2b7e9879a5a5cda6cb550710f55b3caa48
Get_product_titles()
{
# Download page, fix ampersands, convert to XML, parse product titles
wget -qO- https://www.marseus.hu/hu/szamitogep/workstation/hp/ \
| sed -e 's/&\([a-z_]\+\=\)/\&\1/g' \
| xmlstarlet fo --html --recover 2>/dev/null \
@szepeviktor
szepeviktor / signal-without-smartphone.md
Last active Aug 9, 2020
Install Signal without a smartphone
View signal-without-smartphone.md
@szepeviktor
szepeviktor / cached-object-count.php
Last active Jul 11, 2020
PhpFastCache object analyzer with Redis Driver
View cached-object-count.php
<?php
// https://github.com/PHPSocialNetwork/phpfastcache/blob/master/lib/Phpfastcache/Core/Pool/ExtendedCacheItemPoolInterface.php#L49-L64
const DATA_WRAPPER_INDEX = 'd';
// https://github.com/phpredis/phpredis#get
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
View csodálatos-input.php
<?php
// ezzel kéne működjön
// https://symfony.com/doc/current/components/http_foundation.html#accessing-request-data
// https://github.com/symfony/symfony/blob/5.1/src/Symfony/Component/HttpFoundation/ParameterBag.php
namespace Csodálatos
class Input
{
@szepeviktor
szepeviktor / google-search-ads-old-style.js
Last active Jul 26, 2020
Google Search ads old green style
View google-search-ads-old-style.js
// ==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.6.0
// @grant none
// @run-at document-idle
// @include https://www.google.*/search?*
// ==/UserScript==
@szepeviktor
szepeviktor / s3ql-pyenv-stretch.sh
Created Jun 24, 2020
Install S3QL on Python 3.7 (installed by pyenv)
View s3ql-pyenv-stretch.sh
#!/bin/bash
#
# Install S3QL on Debian stretch
#
# DEBIAN-VERSION :stretch
# PYTHON-VERSION :3.7.7
# FUSE3-VERSION :3.4.1
# S3QL-VERSION :3.4.1
@szepeviktor
szepeviktor / python-3.7-pyenv-debian-stretch.sh
Last active Jun 24, 2020
Install Python 3.7 by pyenv on systems that come with an older version
View python-3.7-pyenv-debian-stretch.sh
#!/bin/bash
#
# Install Python 3.7 by pyenv
#
# Prerequisites
apt-get install gcc libssl-dev liblzma-dev uuid-dev libffi-dev libreadline-dev libbz2-dev zlib1g-dev libsqlite3-dev
##apt-get install libssl-dev/jessie-backports
# https://github.com/pyenv/pyenv-installer
@szepeviktor
szepeviktor / KesselőMajom.php
Created Jun 4, 2020
🐒 ArrayAccess implementáció cache-eléshez 🐒
View KesselőMajom.php
<?php
class KesselőMajom implements ArrayAccess
{
const ARRAY_METHODS = [
'__construct',
'offsetSet',
'offsetExists',
'offsetUnset',
'offsetGet',
@szepeviktor
szepeviktor / netpincer-scrollto-category.js
Last active May 28, 2020
Görgetés a kategóriákhoz a Netpincér-en
View netpincer-scrollto-category.js
var netpincerScroll = function (event) {
var $elem = jQuery(event.target);
var id = $elem.data("public-id");
var $header = jQuery(".item-list .category-header[data-public-id=" + id + "]");
$elem.parent().siblings().removeClass("selected");
$elem.parent().addClass("selected");
jQuery("html").scrollTop($header.position().top - 73 - 15 - 60);
};
jQuery(".filter-box .filter-assortment > li > a[data-name]").each( function (_, elem) {
@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active May 28, 2020
Download Wistia videos - Please do not misuse it!
View Wistia-download-videos.md

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
    • alternative: "type":"hd_mp4_video"
You can’t perform that action at this time.