Skip to content

Instantly share code, notes, and snippets.

View abcsds's full-sized avatar

Alberto Barradas abcsds

View GitHub Profile

Setting up qemu VM using nix flakes

Did you know that it is rather easy to setup a VM to test your NixOs configuration?

Create simple flake:

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@ariccio
ariccio / BluetoothConstants.ts
Created January 10, 2022 18:59
GATT services and characteristics
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue.
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800.
// This is a hack to make things easy.
['1800', "generic_access"],
['1801', "generic_attribute"],
['1802', "immediate_alert"],
['1803', "link_loss"],
@hlorand
hlorand / vidstab_ffmpeg.md
Last active March 16, 2025 21:56
Video stabilization using VidStab and FFMPEG

Video stabilization using VidStab and FFMPEG

** Step 1 **

Install ffmpeg with the vidstab plugin.

@nicomollet
nicomollet / polylang-langswitcher-shortcode.php
Last active April 16, 2025 15:26
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@nickoala
nickoala / 0_python_email.md
Last active February 11, 2025 20:23
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@AustinRochford
AustinRochford / pydata_dc_2016_vi_in_python.ipynb
Last active June 17, 2024 07:12
PyData DC 2016 Variational Inference in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@frantic1048
frantic1048 / nvidia-gpu-sensor.pl
Last active October 12, 2020 10:18
KDE KSysGuard NVIDIA GPU temperature/memory/utilization sensor
#!/usr/bin/perl -w
# act as a KSysGuard sensor
# provides NVIDIA GPU info via `nvidia-settings`
# Usage (e.g. add gpu temperature sensor)
# 1. save this file, make sure it has a exec permission
# 2. in KSysGuard's menu, open `File` -> `Monitor Remote Machine`
# 3.1 in new dialog, type `Host` whatever you want
# 3.2 set `Connection Type` to `Custom command`
@Ismael-VC
Ismael-VC / .juliarc.jl
Last active December 23, 2017 15:22
~/.juliarc.jl
using Compat
# using Suppressor
using OhMyREPL
const SEPARATOR = "\n\n" * "#"^80 * "\n\n"
ENV["PYTHON"] = ""
ENV["JULIA_WARN_COLOR"] = :yellow
ENV["JULIA_INFO_COLOR"] = :cyan
# ENV["LISP_PROMPT_TEXT"] = "λ ↦ "
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active March 14, 2025 14:37
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@hasherezade
hasherezade / brainfuck.l
Created May 28, 2015 18:28
BrainfuckToC (Flex & Bison)
%{
#include "brainfuck.tab.h"
#include <string.h>
#include <stdlib.h>
void error()
{
fprintf(stdout, "Plik niepoprawny pod wzglêdem leksykalnym. Linia: %d\n", yylineno);
exit(1);
}