Skip to content

Instantly share code, notes, and snippets.

View petercao's full-sized avatar
🎯
Focusing

Peter Cao petercao

🎯
Focusing
View GitHub Profile
@petercao
petercao / sepo
Created August 28, 2019 07:36 — forked from invisiblek/sepo
allow init block_device : dir { search };
allow dumpstate dumpstate : rawip_socket { ioctl read write create getattr setattr lock append bind connect getopt setopt shutdown };
allow init qmuxd_socket : fifo_file { read create getattr setattr relabelfrom relabelto unlink open };
allow init sockfs : dir { read setattr search open };
allow init proc_security : dir { read setattr search open };
allowxperm untrusted_app untrusted_app : udp_socket ioctl { 0x5411 0x5451 };
allowxperm untrusted_app untrusted_app : udp_socket ioctl { 0x8906-0x8907 0x8910 0x8912-0x8913 0x8915 0x8917 0x8919 0x891b 0x8921 0x8933 0x8938 0x8942 };
allowxperm untrusted_app untrusted_app : udp_socket ioctl { 0x8b01 0x8b05 0x8b07 0x8b09 0x8b0b 0x8b0d 0x8b0f 0x8b11-0x8b13 0x8b21 0x8b23 0x8b25 0x8b27 0x8b29 0x8b2d };
allow untrusted_app untrusted_app : udp_socket { ioctl read write create getattr setattr lock append bind connect getopt setopt shutdown };
allow drmserver mediaserver : fd { use };
@petercao
petercao / JsonUtils.java
Created November 22, 2022 17:06 — forked from isudox/JsonUtils.java
Java snippets
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.meituan.conch.account.exception.JsonException;
import org.apache.log4j.Logger;
import java.io.InputStream;
@petercao
petercao / urlize.js
Created November 22, 2022 17:06 — forked from isudox/urlize.js
有没有人从零开始刷力扣
// 脚本使用方法请参考 https://www.tampermonkey.net/faq.php 或 https://greasyfork.org/zh-CN (这行代码不要复制)
// 这俩都是国外网站, 上不去的话直接百度 "油猴脚本使用方法" 就行(这行代码也不要复制)
// ==UserScript==
// @name 有没有人一起从零开始刷力扣
// @namespace likou-replace
// @version 1.0
// @description none
// @author Permission
// @match https://leetcode.cn/circle/article/48kq9d/*
@petercao
petercao / Customizer.jsx
Created April 18, 2023 08:22 — forked from adrianhajdin/Customizer.jsx
Build and Deploy an AI-Powered 3D Website Using React | 2023 Three JS Course Tutorial for Beginners
{/* Download button */}
<button className='download-btn' onClick={downloadCanvasToImage}>
<img
src={download}
alt='download_image'
className='w-3/5 h-3/5 object-contain'
/>
</button>
#!/bin/bash
reset
set +x
echo "------- LE2117 to LE2115 Conversion Bash Script by Lomeli12@xda -------"
echo "Please make sure you are in bootloader, your screen should say \"Fastboot Mode\" in red."
echo "You should be using the latest Google platform tools from your system's package manager (Apt, Yay, Brew, Scoop, etc)."
echo -e "Do not continue if you are unsure. \n"
# Make sure the user knows the risk and wants to continue
while true; do