Skip to content

Instantly share code, notes, and snippets.

View yangwao's full-sized avatar
🥋
Mastering the code

Matej yangwao yangwao

🥋
Mastering the code
View GitHub Profile
M4 {+KC_LALT}{+KC_LGUI}{+KC_LEFT}{-KC_LALT}{-KC_LGUI}{-KC_LEFT}
M5 {+KC_LALT}{+KC_LGUI}{+KC_RGHT}{-KC_LALT}{-KC_LGUI}{-KC_RGHT}
M6 {KC_LCTL,KC_LGUI,KC_SPC}
M13 {KC_LGUI,KC_MINS}
M14 {KC_LGUI,KC_EQL}
M15 {KC_RGUI,KC_0}
@yangwao
yangwao / split_keyboards.md
Created April 18, 2023 20:09 — forked from itod/split_keyboards.md
Every "split" mechanical keyboard currently being sold that I know of
10:03:23 ❯ brew install julia-nightly
]
add Plots
add JSON
include("threeBodyProb.jl")
main(custom=true)
@yangwao
yangwao / hazmatsuite.js
Created January 24, 2022 14:13
RegExp Kusama Address
// match Substrate/KSM address, experimental
// Warning: Do not use regular expressions (regex) to validate addresses.
// Always verify using the prefix and checksum of the address.
// Substrate API Sidecar provides an accounts/{accountId}/validate path that returns a boolean isValid response for a provided address.
// If you want to validate addresses in another way, see the validation documentation.
const lookupForAddress = /kodadot.xyz\/transfer\/\?target=\w[a-zA-Z0-9]{46}\b/g;
const matchAddress = /\w[a-zA-Z0-9]{46}\b/g;
const destination_address = matchAddress.exec(lookupForAddress.exec(pr_status.data.body))
@yangwao
yangwao / sidecar_monterey.app
Last active February 4, 2022 13:37
sidecar_monterey.app
### How to connect ipad as secondary display at Monterey
### Connect Side Car on Monterey
### Author https://twitter.com/yangwao
### https://github.com/yangwao
### Open script editor and save as app
### Don't forget to add permisions in privacy window to controll it
### Original Source https://www.reddit.com/r/MacOS/comments/il8x0y/is_it_possible_to_automatically_connect_to/g3tlhxc/
### Missing to check for accidental glitches if ipad is connected, but not showing display, yeah happen so something that would cycle would be warm welcome
### You need allow permission in Security & Privacy > Accessibility > your_script_name.app
set controlCenterName to "Control Centre"
set connectToSidecarName to "Connect to Sidecar"
set iPadName to "Magnetic tunnel"
tell application "System Events"
tell application process "ControlCenter"
set controlCenterIcon to (menu bar item controlCenterName of menu bar 1)
click controlCenterIcon
if not (exists (window controlCenterName)) then
@yangwao
yangwao / grayscale.app
Last active December 10, 2021 14:33
activate remove boring windows for humans
### Open script editor and save as app
### dont forget to add permisions in privacy window to controll it
### ht vikiival for evening cracking
### delay is might tricky!
### credits goes to https://gist.github.com/silesky/2da3a6bef1703e38d901ec9c623eecbd
tell application "System Preferences"
set the current pane to pane id "com.apple.preference.universalaccess"
delay 0.3 #needs time to open universal access
tell application "System Events" to tell process "System Preferences" to tell window "Accessibility"
20:44:20 ❯ cat useforce.sh
#!/bin/bash
osascript sidecar.scpt
~
20:44:22 ❯ cat sidecar.scpt
#!/usr/bin/env osascript
set controlCenterName to "Control Centre"
set connectToSidecarName to "Connect to Sidecar"

On Feb. 21, 2010, a con­voy of vehicles car­ry­ing ci­vil­ians headed down a moun­tain in cent­ral Afgh­anistan. Amer­ic­an eyes were watch­ing. For more than four hours, the U.S. mil­it­ary — in­clud­ing a Pred­at­or drone crew in Nevada, video screen­ers in Flor­ida, an AC-130 air­plane crew in the sky and an Amer­ic­an spe­cial op­er­a­tions unit on the ground nearby — tracked the con­voy, try­ing to de­cide wheth­er it was friend or foe. This is the of­fi­cial U.S. mil­it­ary tran­script of the ra­dio trans­mis­sions and cock­pit con­ver­sa­tions that day, ob­tained by the Los Angeles Times through a Free­dom of In­form­a­tion Act re­quest.

This is a cleaned up copy of the transcript obtained by the LA Times, retrieved from http://documents.latimes.com/transcript-of-drone-attack/

I downloaded the PDF, ran pdf2txt on it, ran the following Python program to clean it up, then did manual edits.

import sys
@yangwao
yangwao / ksm.py
Last active February 1, 2021 15:17 — forked from vikiival/ksm.py
Price of Edgeware for last 30 days
from pycoingecko import CoinGeckoAPI
import datetime
from statistics import median, mean
cg = CoinGeckoAPI()
def main():
numdays = 30
base = datetime.datetime.today()
date_list = [base - datetime.timedelta(days=x) for x in range(numdays)]
fn_format = lambda x: x.strftime("%d-%m-%Y")