Skip to content

Instantly share code, notes, and snippets.

View dedobbin's full-sized avatar

dedobbin

  • https://koindozer.org/dat/
View GitHub Profile
/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html
@asamy
asamy / cmd.S
Last active February 21, 2022 19:39
Retrieving command-line arguments in x86 assembly.
/*
Copyright (C) 2013 Ahmed Samy <[email protected]>, MIT.
Retrive command line arguments and output them to stdout.
Compile:
gcc cmd.S
Run:
./a.out 1 2 3
Should output:
There are 4 params:
@leovoel
leovoel / basic_bot.py
Last active January 25, 2024 04:19
discord.py's basic_bot.py converted to use "cogs".
from discord.ext import commands
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
# this specifies what extensions to load when the bot starts up
startup_extensions = ["members", "rng"]
@EvieePy
EvieePy / error_handler.py
Last active November 8, 2024 11:38
Simple Error Handling for ext.commands - discord.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions