Skip to content

Instantly share code, notes, and snippets.

@GoodbyeNJN
GoodbyeNJN / 墓碑模式FCM推送v3.0-b.json
Last active May 3, 2024 13:14
墓碑模式 FCM 推送
[
{
"name": "墓碑模式FCM推送v3.0-b",
"description": "对于支持FCM推送的 **非黑名单** 应用,当其收到推送并且处于后台时,临时解冻3秒。\n仅适配了NoActive Pro版本。全局变量示例:[ \"0#com.tencent.mm\", \"10#com.tencent.mm\" ],井号前后分别为用户id和包名。",
"priority": -1,
"condition": "fcmPushMessageArrived == true",
"actions": [
"def debug(msg) { log.log(\"🚀 \" + msg); } def getUserIdList() { userList = context.getSystemService(context.USER_SERVICE).getUsers(); userIdList = (identifier in (userHandle in userList)); return userIdList; } def isValidPkg(pkg) { return thanos.getPkgManager().getAppInfo(pkg) != null; } def getPkgListByPkgName(pkgName) { userIdList = getUserIdList(); res = []; foreach(userId: userIdList) { pkg = Pkg.newPkg(pkgName, userId); if (isValidPkg(pkg)) { res.add(pkg.userId + \"#\" + pkg.pkgName); } } return res; } def isPkgFrozen(pkg) { return su.exe(\"pm freezer query \" + pkg + \" | awk '/isFrozen/ {print $2}'\").out[0]; } def unfreezePkg(pkg) { su.exe(\"pm freezer temporaryThaw \" + pkg); } def checkGlobalVar(pkg) { if (globalVar
@amk221
amk221 / placeholder.css
Last active May 3, 2024 13:11
Prosemirror placeholder plugin approach
.ProseMirror[data-placeholder]::before {
color: global.$placeholder-colour;
position: absolute;
content: attr(data-placeholder);
pointer-events: none;
}
@Zynth-dev
Zynth-dev / update_evohome_locations.sh
Last active May 3, 2024 13:11
Hass: Multiple Evohome Locations. Script to automatically create/update the integrations.
#!/bin/bash
#Purpose: Create/Update your multiple evohome locations in the folder custom_components/
#Based on the wiki: https://github.com/zxdavb/evohome-async/wiki/Hass:-Multiple-Evohome-Locations
#This script is tested on Home Assistant OS.
#It should be placed in this location and run from there: /config/custom_components/
#Run the script when you want to install multiple evohome locations.
#Run the script every time you have updated the HA core.
#How many extra copies of the integration do you want?
@darth-veitcher
darth-veitcher / Plex.yaml
Last active May 3, 2024 13:09
Plex on Kubernetes
apiVersion: v1
kind: Secret
metadata:
name: plex-claim-token
namespace: media
type: Opaque
data:
token: ${API_TOKEN_OPAQUE}
---
apiVersion: v1
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active May 3, 2024 13:09
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@qoomon
qoomon / conventional_commit_messages.md
Last active May 3, 2024 13:09
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@justinledwards
justinledwards / camerasettings.sh
Created September 17, 2015 23:12
Camera settings on v4l2
#!/bin/bash
v4l2-ctl -c brightness=0
v4l2-ctl -c contrast=120
v4l2-ctl -c white_balance_temperature_auto=0
v4l2-ctl -c gamma=120
v4l2-ctl -c white_balance_temperature=4700
v4l2-ctl -c sharpness=100
v4l2-ctl -c backlight_compensation=0
v4l2-ctl -c focus_absolute=10
v4l2-ctl --list-ctrls-menus
@bizz84
bizz84 / main.dart
Last active May 3, 2024 13:07
Simple Emil & Password auth flow with Flutter & Firebase UI
import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider;
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:simple_auth_flutter_firebase_ui/firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
@spig
spig / install_cups+airprint_centos7.md
Created February 15, 2018 14:52 — forked from jpawlowski/install_cups+airprint_centos7.md
Install and configure CUPS 2.1.2 on CentOS 7 (LXC running on Proxmox VE) host including AirPrint

Basic setup, e.g. enable ssh

yum -y install epel-release
yum -y upgrade
yum -y install openssh-server net-tools iputils psmisc less which man mc bash-completion bash-completion-extras bash-argsparse bind-utils traceroute htop mtr
echo "export HISTTIMEFORMAT='%F %T  '" > /etc/profile.d/history.sh
echo "export HISTIGNORE='ls -l:pwd:date:'" >> /etc/profile.d/history.sh
echo "export HISTCONTROL=ignoredups" >> /etc/profile.d/history.sh
systemctl enable sshd
systemctl start sshd
@arrieta
arrieta / lexer.cpp
Last active May 3, 2024 13:06
Simple C++ Lexer
// A simple Lexer meant to demonstrate a few theoretical concepts. It can
// support several parser concepts and is very fast (though speed is not its
// design goal).
//
// J. Arrieta, Nabla Zero Labs
//
// This code is released under the MIT License.
//
// Copyright 2018 Nabla Zero Labs
//