Skip to content

Instantly share code, notes, and snippets.

View blackavec's full-sized avatar
🎡
Coding & Composing

Mahan Sagharchi blackavec

🎡
Coding & Composing
View GitHub Profile
@blackavec
blackavec / endurance-planning.md
Created April 10, 2025 12:56
2-Week Bass Endurance Plan (30–60 min daily)

14-Day Bass Practice Routine

Day Focus Area Drills (with Metronome) Time (min) Notes
1 Finger Warm-up + Loops Chromatic + spider + 2-bar groove loop 30 Loop for 5–10 min sets
2 String Skipping Basic pattern (↑) + advanced pattern skipping 2 strings 40 Add 2-note chords for variation
3 Long Groove Set Play one groove/riff for 15 min straight 45 Stand while playing
4 Technique Mix Slap, pop, muting drills 30 Use timer reps
5 Improvised Jam Backing track jam w/ groove focus 45 Stay in pocket
6 High-
@blackavec
blackavec / 2019-top10-languages-playgrounds.md
Created January 14, 2023 13:28
list of the top 10 popular programming languages according to Stack Overflow in 2021 and the associated playground (sandbox) platforms in markdown format
@blackavec
blackavec / gist:5962d455eb0697e61eb1578776f4edd0
Created August 28, 2022 16:49
How to flash ESP32 without holding reset/boot button
# Requirements
- 2x Resistors (10K)
- 2x Transistors (S8050)
- USB to UART Module
- ESP32
#!/bin/bash
#apt-get update
#apt-get upgrade -y
apt-get install build-essential
% node --print-bytecode --print-bytecode-filter=testFor scenarios/bytecode/benchmark.js
[generated bytecode for function: testFor]
Parameter count 2
Frame size 16
78 E> 0x596d72600ba @ 0 : a0 StackCheck
96 S> 0x596d72600bb @ 1 : 0c 0a LdaSmi [10]
0x596d72600bd @ 3 : 26 fb Star r0
102 E> 0x596d72600bf @ 5 : a0 StackCheck
116 S> 0x596d72600c0 @ 6 : 25 fb Ldar r0
0x596d72600c2 @ 8 : 73 00 ToNumeric [0]
function testFor(obj) {
let i = 10
for(;;) {
if (i-- === 0)
return true
}
}
function testWhile(obj) {
module.exports.scenario = function() {
let runCycles = totalExecutionLimit // 1,000,000,000
setInitialTime()
while (true) {
// do the calculation
add(2, 2)
if (!runCycles--)
break
module.exports.scenario = function() {
let runCycles = totalExecutionLimit // 1,000,000,000
setInitialTime()
for (;;) {
// do the calculation
add(2, 2)
if (!runCycles--)
break
module.exports.add = function(a, b) {
return a + b
}
2.hours.ago # => Fri, 02 Mar 2012 20:04:47 JST +09:00
1.day.from_now # => Fri, 03 Mar 2012 22:04:47 JST +09:00
Date.today.to_time_in_current_zone # => Fri, 02 Mar 2012 22:04:47 JST +09:00
Date.current # => Fri, 02 Mar
Time.zone.parse("2012-03-02 16:05:37") # => Fri, 02 Mar 2012 16:05:37 JST +09:00
Time.zone.now # => Fri, 02 Mar 2012 22:04:47 JST +09:00
Time.current # Same thing but shorter. (Thank you Lukas Sarnacki pointing this out.)
Time.zone.today # If you really can't have a Time or DateTime for some reason
Time.zone.now.utc.iso8601 # When supliyng an API (you can actually skip .zone here, but I find it better to always use it, than miss it when it's needed)
Time.strptime(time_string, '%Y-%m-%dT%H:%M:%S%z').in_time_zone(Time.zone) # If you can't use Time#parse