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 / 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 / convert-clipboard-image.py
Last active October 19, 2023 12:27
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 / 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 / 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 ray@rayps.com
// @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 / Custom-UIFont.swift
Last active August 21, 2021 07:08
Custom UIFont with font-family/font-weight/font-style/font-size by UIFontDescriptor
// Put font files to Xcode project.
// Add this properties to Info.plist:
// Fonts provided by application
// Item 0: SF-Pro-Display-Regular.otf
// Item 1: SF-Pro-Display-Bold.otf
// Item 2: ...
// Tips: To get the list of iOS SDK built-in fonts you can found on http://iosfonts.com
// Or type "po [UIFont familyNames]" in Xcode lldb console.
@RayPS
RayPS / Framer-Simple-Grid.coffee
Last active March 20, 2021 13:41
Framer Simple Grid
column = 4
count = 19
gutter = 10
cellSize =
width: 100
height: 100
for i in [0...count]
offsetX = i % column
offsetY = Math.floor i / column
@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 / 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 / Framer-Design-At-1x.coffee
Last active March 4, 2018 13:04
Framer Design At 1x
is_iPhone = Framer.Device.deviceType.includes "apple-iphone"
is_iPhonePlus = Framer.Device.deviceType.includes "plus"
is_iPhoneNotPlus = is_iPhone and not is_iPhonePlus
if is_iPhonePlus and Utils.isFramerStudio() then Framer.Device.content.scale = 3
if is_iPhoneNotPlus and Utils.isFramerStudio() then Framer.Device.content.scale = 2
document.querySelector("head>meta[name=viewport]").setAttribute "content",
"width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no"
Framer.Device._update()