Skip to content

Instantly share code, notes, and snippets.

View RayPS's full-sized avatar
🏠
Working from home

Ray RayPS

🏠
Working from home
View GitHub Profile
@RayPS
RayPS / MarvelSnap.list
Last active April 29, 2024 03:56
Marvel Snap surge rules
DOMAIN-SUFFIX,marvelsnap.com
DOMAIN-SUFFIX,snapgametech.com
DOMAIN-SUFFIX,bytegsdk.com
DOMAIN-SUFFIX,byteoversea.com
DOMAIN-SUFFIX,tiktokv.com
DOMAIN-SUFFIX,isnssdk.com
DOMAIN-SUFFIX,unity3d.com
DOMAIN-SUFFIX,unity3dusercontent.com
DOMAIN-SUFFIX,api.unity.com
DOMAIN-SUFFIX,braze.com
@RayPS
RayPS / convert-clipboard-image.py
Last active August 13, 2024 03:37
Converting image format in clipboard - macOS Python (Copied as PNG, Paste as JPG)
from PIL import Image
import io
import pasteboard
pb = pasteboard.Pasteboard()
pb_image = pb.get_contents(pasteboard.TIFF)
if pb_image:
image = Image.open(io.BytesIO(pb_image))
if image.mode == 'RGBA':
image.load()
@RayPS
RayPS / rm-pasf.js
Last active November 6, 2022 13:24
Remove the annoying "People also search for" from Google Search result
// ==UserScript==
// @name Remove "People also search for"
// @description Remove "People also search for" on Google
// @namespace [email protected]
// @version 0.1.1
// @author Ray
// @match https://*.google.com/search*
// @match https://*.google.com.hk/search*
// @icon https://www.google.com/s2/favicons?domain=google.com
// ==/UserScript==
@RayPS
RayPS / Proxmark3.md
Last active December 8, 2020 14:46
Proxmark3 Mac (homebrew) File .eml not found or locked

Before:

$ proxmark3 /dev/cu.usbmodem14401
$ hf mf eload /Users/ray/Downloads/my-dump-file.eml

File /Users/ray/Downloads/my-dump-file.eml.eml not found or locked

After:

$ cd ~/Downloads
@RayPS
RayPS / ray-zim.zsh-theme
Last active April 11, 2023 11:54
A zsh theme made for myself, please use with FiraCode font
# https://github.com/zimfw/git-info
# Requires the `git-info` zmodule to be included in the .zimrc file.
if (( ! ${+MAGENTA} )) typeset -g MAGENTA=magenta
if (( ! ${+YELLOW} )) typeset -g YELLOW=yellow
if (( ! ${+GREEN} )) typeset -g GREEN=green
if (( ! ${+CYAN} )) typeset -g CYAN=cyan
if (( ! ${+RED} )) typeset -g RED=red
if (( ! ${+BLUE} )) typeset -g BLUE=blue
if (( ! ${+BLACK} )) typeset -g BLACK=black
@RayPS
RayPS / modulate.swift
Last active August 22, 2019 13:00
Swift modulate CGFloat between two ranges.
extension CGFloat {
func modulate(from: [CGFloat], to: [CGFloat], limit: Bool) -> CGFloat {
let result = to[0] + (((self - from[0]) / (from[1] - from[0])) * (to[1] - to[0]))
return limit ? [[result, to.min()!].max()!, to.max()!].min()! : result
}
}
@RayPS
RayPS / kali-linux-macbook-air-wifi.md
Last active April 23, 2024 15:04
Fix Wi-Fi adapter for Kali linux on MacBook Air

Fix Wi-Fi adapter for Kali linux on MacBook Air

https://http.kali.org/kali/pool/non-free/b/broadcom-sta/

Download the latest broadcom-sta-dkms_XXXXXXXXXXXXXXX_all.deb from the link above

For example:

$ wget http://http.kali.org/kali/pool/non-free/b/broadcom-sta/broadcom-sta-dkms_6.30.223.271-24_all.deb
@RayPS
RayPS / Allow-to-use-wireless-data.swift
Created November 21, 2017 08:34
Grant internet access before loading any data. Only for China Apple Devices.
override func viewDidLoad() {
super.viewDidLoad()
if let url = URL(string: "http://captive.apple.com/generate_204") {
URLSession.shared.dataTask(with: url).resume()
}
}
@RayPS
RayPS / Gradient-Mask.swift
Created November 8, 2017 04:56
Gradient Mask
let gradient = CAGradientLayer()
gradient.colors = [
UIColor.black.cgColor,
UIColor.black.cgColor,
UIColor.clear.cgColor
]
gradient.locations = [
0,
@RayPS
RayPS / Framer-InputLayer.coffee
Last active September 6, 2017 11:37
Simple Framer InputLayer Class
class InputLayer extends Layer
constructor: (options={}) ->
options.html = "<input type='text' value=''>"
super options
@define "input",
get: ->
return @querySelector("input")
# Usage:
textField = new InputLayer
height: 40