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
#!/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= |
#!/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) | |
{ |
// ==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== |
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; |
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 |
# 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' |
-- 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 |