Skip to content

Instantly share code, notes, and snippets.

View tirzasrwn's full-sized avatar

tirzasrwn

View GitHub Profile
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@tirzasrwn
tirzasrwn / CMakeLists.txt
Last active May 25, 2022 04:52
mqtt-example-c
cmake_minimum_required(VERSION 3.10)
project(run C)
add_executable(run mqtt_example.c)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
target_link_libraries(run
mosquitto
)
@tirzasrwn
tirzasrwn / keybindings.json
Last active March 18, 2022 01:20
vscode user keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+shift+/",
"command": "openInTerminal"
},
{
"key": "ctrl+shift+'",
"command": "workbench.action.terminal.kill"
},
@tirzasrwn
tirzasrwn / settings.json
Last active December 23, 2022 00:45
vscode user settings
{
"editor.bracketPairColorization.enabled": true,
"editor.cursorBlinking": "phase",
"editor.cursorSmoothCaretAnimation": true,
"editor.cursorStyle": "block",
"editor.fontFamily": "'Fira Code Retina', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.formatOnSave": false,
"editor.guides.bracketPairs": "active",
@diffficult
diffficult / bluetoothdoubledipping.md
Last active July 17, 2024 10:51
Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

You may have experienced when dual booting that you need to re-pair your bluetooth devices (ie., Headphones, mouse, keyboard, etc) this usually happens because you have already paired the device with another operating system using the same bluetooth adapter when dual booting (either Linux or Windows).

Some devices cannot handle multiple pairings associated with the same MAC address (ie., bluetooth adapter). As per suggested on the ArchWiki you can fix this by re-pairing the device each time, but there's actually another solution to not do so each time you choose to use your device on a different OS.

How can we accomplish this?

Easy, just pair the device on a OS and copy the bluetooth keys generated to the other OS so our device doesn't notice the difference.

@ideoforms
ideoforms / sox-cheat-sheet.sh
Last active July 24, 2024 02:29
sox cheat sheet
################################################################################
# sox cheat sheet
################################################################################
# Example commands for the sox command-line audio processing tool,
# for manipulating or batch processing audio files.
################################################################################
# Daniel Jones <dan-web@erase.net>
################################################################################
################################################################################

Start by getting the correct theme name to use in the next steps:

cat .icons/Breeze-Hacked/index.theme
[Icon Theme]
Name=Breeze-Hacked

So you need

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@extremecoders-re
extremecoders-re / openwrt-qemu.md
Last active July 12, 2024 14:31
Running OpenWRT ARM under QEMU

Environment

The steps shown below are done on a Ubuntu VM using Qemu 3.0

$ qemu-system-arm -version
QEMU emulator version 3.0.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

To quit Qemu at any time press Ctrl+a x, i.e. Ctrl+a and then x

@mrcrilly
mrcrilly / gin_jwt_middleware.go
Last active February 23, 2024 01:13
Gin JWT Middleware (Example)
package main
import (
"errors"
"net/http"
"strconv"
"strings"
"time"
"github.com/dgrijalva/jwt-go"