Skip to content

Instantly share code, notes, and snippets.

View BAMoreira's full-sized avatar

Bernardo de Azevedo Moreira BAMoreira

  • Caruaru - PE
View GitHub Profile
@BAMoreira
BAMoreira / ANSI.md
Created April 16, 2022 21:33 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@BAMoreira
BAMoreira / togvol.sh
Created April 14, 2022 22:12
Volume toggle for Xfce Archlinux
#!/bin/bash
CURRENT_STATE=`amixer -c 1 get Master | egrep 'Playback.*?\[o' | egrep -o '\[o.+\]'`
if [[ $CURRENT_STATE == '[on]' ]]; then
amixer -c 1 set Master mute
else
amixer -c 1 set Master unmute
amixer -c 1 set Speaker unmute
amixer -c 1 set Headphone unmute
@BAMoreira
BAMoreira / bf.c
Created May 31, 2017 03:39 — forked from maxcountryman/bf.c
A simple brainfuck interpreter in C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// initialize the tape with 30,000 zeroes
unsigned char tape[30000] = {0};
// set the pointer to point at the left-most cell of the tape
unsigned char* ptr = tape;