Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# what is m3u8:
# https://notfalse.net/63/m3u8-intro
# https://www.cnblogs.com/f-ck-need-u/p/9033988.html
# how to download m3u8 video:
# you have to install ffmpeg
# 1 in chrome go f12 network tab, find xxx.m3u8 file
# 2 download that file all content to local, generally, that m3u8 file url all pointing to local, we need change to url path
# 2a some video maybe encrypted with, in m3u8 you may see: #EXT-X-KEY:METHOD=AES-128,URI=
@TONYHOKAN
TONYHOKAN / node_screenshot_puppeteer.js
Created April 20, 2019 11:28
simple node script to screen shot whole web page
#!/usr/bin/env node
// must install global puppeteer node module and npm link
const puppeteer = require('puppeteer');
const [,, ...args] = process.argv
const url = args[0]
if (!url)
{
@TONYHOKAN
TONYHOKAN / hktvmall_price_compare.js
Last active April 20, 2019 11:28
compare hktvmall product price to other sites
// ==UserScript==
// @name compare hktvmall product price to other sites
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author TONYHOKAN
// @match https://www.hktvmall.com/*/p/*
// @grant none
// ==/UserScript==
@TONYHOKAN
TONYHOKAN / mac-apps.md
Created January 24, 2019 15:51 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@TONYHOKAN
TONYHOKAN / ParseRSAKeys.java
Created October 1, 2018 14:37 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@TONYHOKAN
TONYHOKAN / jwtRS256.sh
Created October 1, 2018 11:57 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@TONYHOKAN
TONYHOKAN / logger-colors.rb
Created January 28, 2018 15:43 — forked from janlelis/logger-colors.rb
logger-colors
# Colorizes the output of the standard library logger, depending on the logger level:
# To adjust the colors, look at Logger::Colors::SCHEMA and Logger::Colors::constants
require 'logger'
class Logger
module Colors
VERSION = '1.0.0'
NOTHING = '0;0'
@TONYHOKAN
TONYHOKAN / README-Template.md
Created December 25, 2017 15:18 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@TONYHOKAN
TONYHOKAN / meta-tags.md
Created August 8, 2017 02:08 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@TONYHOKAN
TONYHOKAN / gist:bfe00a0da967ef36d82e9aa34b2e027a
Created October 14, 2016 03:55 — forked from klovadis/gist:5170446
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
-- gets all fields from a hash as a dictionary
local hgetall = function (key)
local bulk = redis.call('HGETALL', key)
local result = {}
local nextkey
for i, v in ipairs(bulk) do
if i % 2 == 1 then
nextkey = v
else
result[nextkey] = v