You do everything at your own risk - I don't take any responsibility for any property damage, injuries or other harm caused by applying any of the information here.
This is a simple 5 V (USB...) powered "9 V" constant current mode NiMH charger (7.2/8.4 V) also usable as a LED tester.
The circuit consists of a boost converter (U1: MC34063AD, capacitors C1-C3, resistors R1-R4, diode D1, inductor L1) and a constant current regulator circuit (Q1, Q2 and parts around them). Power input is indicated with a red LED (D2). Additional input protection can be added (TVS between +5V, GND, fuse before the +5V input). The boost converter voltage is set by R3, R4 (1.25 V on VFB pin). The current regulator (PNP transistors BC807 - Q1, Q2 and parts around them) also affects the boost converter through D4, R6 and lowers the boost output voltage when in CC mode to prevent overheating the pass transistor (Q2). CC mode activity is signalized by a green LED (D6). The output is protected against reverse battery connection by D5, F1 (a resettable fuse is used). ESD durability can be improved by adding an 18 V Zener diode between pins 2 and 1 of D5 (anode to pin D1).
Output current can be adjusted by changing R5, in mA it is around 650/R5, here it is set to around 27 mA. No-load voltage is around 13 V. The circuit can be also quite simply modified to achieve higher output voltages (with a better pass transistor - don't exceed SOA - and few modifications - 4.7 volt zener between pins 5 and 4 (A) of U1, higher resistance of R6, R7, higher voltage of C3). 30 V should be achievable with ease.
A prototype was built on a single side board with SMD parts.
The efficiency is only around 50% at 10 V output and 5 V input. This is a quickly built "afternoon project" from spare parts and might need some tuning. Increasing the resistance of R1 to about 1 to 1.5 Ω decreases peak inductor current, which leads to an increase in efficiency and less EMI radiation.