Skip to content

Instantly share code, notes, and snippets.

View bhy's full-sized avatar

Haoyu Bai bhy

  • Bright Jade Pte. Ltd.
  • Singapore
View GitHub Profile
@pklaus
pklaus / AMD.ovdr
Created July 14, 2011 05:17
AMDOverdriveCtrl on Command Line / Terminal (Overclocking to 820MHz)
<?xml version="1.0" encoding="utf-8"?>
<OVERDRIVE_PROFILE>
<PERFORMANCE_LEVEL level="2" gpu="82000" mem="125000" voltage="1100"/>
<PERFORMANCE_LEVEL level="1" gpu="50000" mem="125000" voltage="1000"/>
<PERFORMANCE_LEVEL level="0" gpu="25000" mem="15000" voltage="900"/>
<FAN_SETTING percentage="AUTO"/>
<FAN_CTRL enabled="yes"/>
<FAN_CTRL_CURVE type="2"/>
<FAN_CTRL_POINT nr="0" temperature="2000" percentage="0"/>
<FAN_CTRL_POINT nr="1" temperature="7500" percentage="500"/>
@willurd
willurd / web-servers.md
Last active July 26, 2024 13:45
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@srvm
srvm / set_clocks_jetson.sh
Created April 9, 2015 00:15
Script to set core and memory frequencies on the NVIDIA Jetson TK1 board.
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Format: set_clocks.sh <core_clock (kHz)> <mem_clock (kHz)>"
exit -1
fi
echo "Supported core clocks:"
cat /sys/kernel/debug/clock/gbus/possible_rates
@thomasaarholt
thomasaarholt / autoscale.py
Last active January 23, 2023 15:52
Matplotlib autoscale
def autoscale(ax=None, axis='y', margin=0.1):
'''Autoscales the x or y axis of a given matplotlib ax object
to fit the margins set by manually limits of the other axis,
with margins in fraction of the width of the plot
Defaults to current axes object if not specified.
'''
import matplotlib.pyplot as plt
import numpy as np
if ax is None:
@jacobsoo
jacobsoo / pyDeliveryTimeslots.py
Created April 18, 2020 06:52
This is just a simple script for Covid-19 to check if there are any delivery timeslots based on your postal code.
import os, sys, re
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
def _log(szString):
print(szString)
def main(PostalCode):
'''