Skip to content

Instantly share code, notes, and snippets.

View myfreeer's full-sized avatar
💭
I may be slow to respond.

myfreeer

💭
I may be slow to respond.
View GitHub Profile
@myfreeer
myfreeer / getSelector.js
Last active March 8, 2018 10:04
get selector from element
/**
* Is a selector returns only one result
* @param {String} selector - number of threads to run
* @return {Boolen} result
*/
const isUniqueSelector = (selector) => {
const result = document.querySelectorAll(selector);
if (result && result.length === 1)
return true;
return false;
@myfreeer
myfreeer / 7-zip-build.bat
Last active November 25, 2022 14:41
7-zip build script
@echo off
setlocal EnableExtensions EnableDelayedExpansion
pushd "%~dp0"
:Download_7zip
set version=7z1803
appveyor DownloadFile https://www.7-zip.org/a/%version%-src.7z
7z x %version%-src.7z
:Patch
// ==UserScript==
// @name fix to width
// @namespace https://addons.mozilla.org
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://*/*
// @match https://*/*
// @grant none
// @run-at document-start
@myfreeer
myfreeer / build-dnscrypt-proxy-appveyor.yml
Last active October 22, 2017 07:53
static dnscrypt-proxy build scripts for windows on msys2
version: 1.0.{build}
build_script:
- cmd: >-
C:\msys64\usr\bin\pacman -Syyuu --noconfirm
C:\msys64\usr\bin\pacman -Suu --noconfirm
appveyor DownloadFile https://gist.github.com/myfreeer/bef0503907b9559d604c89f9b630a62b/raw/build-dnscrypt-proxy.sh
set MSYSTEM=MINGW64
From ab8255b36ef03ba415b88a514bf52527cc11d563 Mon Sep 17 00:00:00 2001
From: myfreeer <myfreeer@users.noreply.github.com>
Date: Fri, 15 Sep 2017 09:17:33 +0800
Subject: [PATCH] webp: change default options
---
src/photoshop/WebP.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/photoshop/WebP.cpp b/src/photoshop/WebP.cpp
#!/bin/bash
# https://unix.stackexchange.com/a/40897
# float number calc
calc() {
awk "BEGIN{print $*}";
return $?
}
LANG=C
duration=""
@myfreeer
myfreeer / net-disk-code-autofill.user.js
Last active November 30, 2017 12:34
网盘自动填写密码【增强版】修改,仅在存在提取码时提交 && 修复parent.nextSibling不存在时的错误,https://greasyfork.org/zh-CN/forum/discussion/27841/
// ==UserScript==
// @name 网盘自动填写密码【增强版】
// @description 网盘自动填写提取密码【增强版】+网盘超链接与提取码融合。
// @author 极品小猫
// @namespace http://www.cnblogs.com/hkmhd/
// @homepage https://greasyfork.org/scripts/13463
// @supportURL https://greasyfork.org/scripts/13463/feedback
// @version 2.5.3.1
// @date 2015.10.30
// @modified 2017.07.19
@myfreeer
myfreeer / zhihu-real-image.user.js
Last active July 6, 2017 13:42
Replace lazy-loaded and blurred canvas with real image on zhihu.com
// ==UserScript==
// @name Zhihu Real Image
// @name:zh-CN 知乎真实图片
// @namespace myfreeer
// @version 0.1
// @description Replace lazy-loaded and blurred canvas with real image (causing many errors in console)
// @description:zh-CN 将懒加载的模糊的canvas替换为真实图片(会导致控制台产生大量错误)
// @author myfreeer
// @match https://*.zhihu.com/question/*
// @match http://*.zhihu.com/question/*
@echo off
setlocal EnableExtensions EnableDelayedExpansion
echo. Batch DPI Modifier for Photoshop
echo. Required a sendinput.exe from https://github.com/myfreeer/sendinput/releases/latest
echo.
:Num
set /p "num=Enter Number of Files:"
if "%num%"=="" goto :Num
echo.
:Dpi
@myfreeer
myfreeer / perf-opt-4k.lua
Last active August 26, 2017 13:17
optimize performance for 4k
-- optimize performance for 4k
-- on high-res (width > 1920) videos:
-- pre-scale high-res to half the size using lavfi scale filter
-- change deband to no
-- change correct-downscaling to no
-- on normal-res videos:
-- revert everything back
-- from https://github.com/mpv-player/mpv/blob/39e04e929483847a3e0722d86d53f69837ed99db/TOOLS/lua/autocrop.lua
function del_filter_if_present(label)