Skip to content

Instantly share code, notes, and snippets.

@panlatent
panlatent / justfile
Last active February 19, 2025 02:15
Jestfile: DDEV Filament Laravel
# Justfile for DDEV + Filament + Laravel
#
# (!) This is the configuration I use personally, and I try to keep it consistent,
# but compatibility is still not guaranteed.
#
# @author Panlatent<panlatent@gmail.com>
# @see https://gist.github.com/panlatent/48fa2eb3c716c9d193d37fcae276cb7c
set dotenv-load
@panlatent
panlatent / jd.js
Created March 28, 2023 03:06 — forked from v5tech/jd.js
JD自动评价
/**
浏览器打开www.jd.com登录账号,按F12点击Console->复制下列代码->粘贴回车键坐等即可
*/
document.body.innerHTML = "";$("html").css("overflow","hidden");$("body").append('<div id="topTitle" style="padding:20px;display:block;font-size:48px;color:#FFFFFF;background-color:#e2231a;width:100%;text-align:center">京东自动评价JS脚本 </div><iframe src="https://club.jd.com/myJdcomments/myJdcomment.action?sort=0" style="width:99%;height:800px" id="JDifr"></iframe>');$("#J-global-toolbar").remove();let isFiveStar = true;$("#topTitle").click(function(){(isFiveStar = !isFiveStar) ? $("#topTitle").css("background-color","#e2231a"):$("#topTitle").css("background-color","#8B0000");});let pendingNum = 1;let waitSubmitIds;let curId = 0;let maxCurId = 0;$("#JDifr").load(function(){if($("#JDifr").attr("src").indexOf("sort") > 0){pendingNum = ($("#JDifr").contents().find("a.text:first").siblings().length>0 && $("#JDifr").contents().find("a.text:first").attr("href")=="?sort=0")?parseInt($("#JDifr").contents().find("a.text:first").next().text()):0;waitSubmitIds = $("#
@panlatent
panlatent / clear-opcache.php
Last active September 10, 2019 08:35
Clear PHP Opcache
<?php
/**
* Clear PHP Opcache from HTTP request.
*
* @author Panlatent <panlatent@gmail.com>
* @version 1.0
*/
$secret = getenv('PHP_OPCACHE_SECRET');
@panlatent
panlatent / php7.4_configure.bash
Last active September 5, 2019 01:19
PHP 7.4 compile configure script (macOS)
./configure \
--prefix=/usr/local/Cellar/php@7.4 \
--sysconfdir=/usr/local/etc/php/7.4 \
--with-config-file-path=/usr/local/etc/php/7.4 \
--enable-cli \
--disable-cgi \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--disable-phar \
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table area_city
sudo plutil -convert xml1 /System/Library/CoreServices/SystemFolderLocalizations/zh_CN.lproj/SystemFolderLocalizations.strings
sudo code /System/Library/CoreServices/SystemFolderLocalizations/zh_CN.lproj/SystemFolderLocalizations.strings
sudo plutil -convert binary1 /System/Library/CoreServices/SystemFolderLocalizations/zh_CN.lproj/SystemFolderLocalizations.strings
touch you_path/.localized
@panlatent
panlatent / gist:a6041e09ffe490c43332
Last active August 29, 2015 14:07
Git: remove remote all tags.
<?php
if (exec('git ls-remote --tags', $tags)) {
echo 'Remove tags:';
foreach ($tags as &$tag) {
preg_match('/^[a-f0-9]+\srefs\/tags\/([^^]*).*$/', $tag, $match);
$tag = $match[1];
}
$tags = array_unique($tags);
exec('git push origin --delete ' . implode(' ', $tags));