Skip to content

Instantly share code, notes, and snippets.

@nicholascw
nicholascw / i3bar-metar.zsh
Last active February 24, 2024 19:03
i3bar METAR information fetched from FAA AviationWeather.gov API
# For base16 colors, visit https://github.com/tinted-theming/base16-shell/tree/main
metar_bar () {
echo '{"version":1, "click_events":true}'
echo '['
echo "[{\"name\":\"refresh\",\"full_text\":\"Refreshing...\"}]"
while true
do
METAR_JSON=$(curl -s -X 'GET' "https://aviationweather.gov/api/data/metar?ids=$1&format=json&taf=false" -H "accept: text/plain")
METAR_GEOJSON=$(curl -s -X 'GET' "https://aviationweather.gov/api/data/metar?ids=$1&format=geojson&taf=false" -H "accept: text/plain")
@nicholascw
nicholascw / i3bar-mpris.zsh
Last active February 24, 2024 09:27
i3bar MPRIS control using zsh and playerctl
mpris_bar () {
echo '{"version":1, "click_events":true}'
echo '['
echo '[]'
mpris_cur_player=0
while :;
do
mpris_players=( $(playerctl -l) )
num_of_players=$#mpris_players
if [[ $num_of_players -eq 0 ]]; then
@nicholascw
nicholascw / loophole.json
Created May 7, 2021 09:44
How you properly profiling V2Ray's performance
{
"inbounds": [
{
"port": 5200,
"listen": "127.0.0.1",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 5201,
"network": "tcp",
@nicholascw
nicholascw / log.h
Created September 23, 2020 06:13
SLOWProxy log macros modified for CS courses
/*
* This file is adapted exclusively for CS438 MPs, from part of the
* SLOWProxy distribution (https://github.com/nicholascw/SLOWProxy).
* Copyright (C) 2020 Nicholas Wang
*
* ======= NOTICE to Grading Instructor =======
* This file is authored by the one submitting this solution, and the
* original open-sourced copy is signed with the same GPG key.
* ============ End of the Notice =============
*
@nicholascw
nicholascw / install_su2_calculix_precice.sh
Last active December 21, 2019 04:15
Install SU2+Calculix+preCICE bundle for current user
#!/bin/bash
# Install SU2+Calculix+preCICE bundle for current user
#
# Usage: curl -L https://biuu.ga/getspc | bash | tee install.log
# Author: Nicholas Wang
# Date: Dec 20, 2019
# Based on:
# Ubuntu: 18.04 (bionic)
# CalculiX: 2.15
# SU2: 6.0.0

Keybase proof

I hereby claim:

  • I am nicholascw on github.
  • I am nicholascw (https://keybase.io/nicholascw) on keybase.
  • I have a public key whose fingerprint is D7FE DFB4 EA83 4EF9 FB13 013F 70D3 4759 8C18 F6B0

To claim this, I am signing this object: