Skip to content

Instantly share code, notes, and snippets.

View bachvtuan's full-sized avatar
🏡
make it works

Tuan Bach Van bachvtuan

🏡
make it works
View GitHub Profile
@louisgv
louisgv / mic-recorder.ts
Last active March 7, 2024 12:16
AudioWorklet replacement for ScriptProcessorNode
const main = async () => {
const context = new AudioContext();
const microphone = await navigator.mediaDevices
.getUserMedia({
audio: true
})
const source = context.createMediaStreamSource(microphone);
@raprasad
raprasad / change_password.md
Last active July 4, 2024 17:20
django user; change password from shell

update django password

general changes

To use in dev environments

  • after python manage.py shell
from django.contrib.auth.models import User
@mattes
mattes / check.go
Last active June 12, 2024 19:31
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}