Skip to content

Instantly share code, notes, and snippets.

View palaniraja's full-sized avatar

palaniraja palaniraja

View GitHub Profile
@robert-saramet
robert-saramet / riscv_guide_1.md
Created July 19, 2025 10:11
Comprehensive Guide to 32-Bit RISC-V Assembly Programming (RV32I)

Comprehensive Guide to 32-Bit RISC-V Assembly Programming (RV32I)

This guide provides a thorough introduction to programming in 32-bit RISC-V assembly language, focusing on the RV32I base integer instruction set. It starts with content from this cheat sheet and expands it into a complete, structured reference. The guide is organized for easy navigation, with clear sections, tables for listings, explanations, examples, and notes. It draws from official specifications and tutorials to ensure accuracy and completeness. Beginners can follow sequentially, while experienced users can reference specific sections.

Key assumptions:

  • We use the GNU Assembler (GAS) syntax, common for RISC-V tools.
  • Examples assume a bare-metal or simple simulator environment (e.g., RARS, Spike, or QEMU).
  • RV32I is the base; extensions like M (multiply/divide) are noted but not required unless specified.
  • Code snippets are testable in simulators; error handling and overflows are ign
@gingerbeardman
gingerbeardman / volumes.60s.sh
Last active June 24, 2025 12:44
xbar/bitbar shell script to list and clean and eject (unmount using option) volumes as a replacement for CleanMyDrive
#!/bin/zsh
# <bitbar.title>Volume Manager</bitbar.title>
# <bitbar.version>250624</bitbar.version>
# <bitbar.author>Matt Sephton</bitbar.author>
# <bitbar.author.github>gingerbeardman</bitbar.author.github>
# <bitbar.desc>Lists and manages mounted user volumes</bitbar.desc>
# <bitbar.dependencies>zsh</bitbar.dependencies>
# <bitbar.abouturl>https://gist.github.com/gingerbeardman/610f22180117ad20465d7c529cc5faa0</bitbar.abouturl>
setopt EXTENDED_GLOB
@ChaitanyaKatti
ChaitanyaKatti / FlySky_ESP32_BLE.ino
Last active June 27, 2025 20:40
ESP32 + FlyFky Transmiter, PPM to BLE Gamepad for simulation
// 8 Channel PPM output from flysky fs-i6X tranmitter,
// Ch1/2/3/4 - Default
// SwA - Ch5
// SwB - Ch6
// SwC - Ch7
// SwD - Ch8
#define numChannels 8
#define axisMin 0
#define axisMax 32767 // Seems that this should be set to 127 for Android devices
@bjhomer
bjhomer / cross-view-lines.swift
Last active March 22, 2026 17:37
Creating cross-view lines in SwiftUI
//
// ContentView.swift
// SwiftUIPlayground
//
// Created by BJ Homer on 4/26/21.
//
import SwiftUI
@lisamelton
lisamelton / manuscript.latex
Last active August 10, 2025 00:29
LaTeX template for Pandoc to create PDFs in standard manuscript format with both short story and novel layouts.
%
% manuscript.latex
%
% Copyright (c) 2022 Don Melton
%
% LaTeX template for Pandoc to create PDFs in standard manuscript format
% with both short story and novel layouts.
%
% Version: 2022052301
%
import UIKit
extension UITextField {
/// Add a trailing placeholder label that tracks the text as it changes
func addTrailingPlaceholder(_ placeholder: String) {
let label = UILabel()
label.text = placeholder
label.alpha = 0.3
label.isHidden = true
let container = UIView()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASCII to Binary</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<style>
body {
@kevinjalbert
kevinjalbert / mirror.scpt
Last active March 30, 2025 21:44
AppleScript to Mirror iPhone to QuickTime
set deviceName to "Kevin’s iPhone"
activateScreenKeepAwake()
readyQuickTime()
setVideoInput(deviceName)
setAudioInput(deviceName)
setVolume(1.0)
setScreenSize("maximize")
# ----- Functions -----
@typesanitizer
typesanitizer / Assembly intro comic.md
Created October 24, 2020 22:22
Assembly intro comic - textual version

Assembly is wacky but cool!

Author: Varun Gandhi (@typesanitizer)

Panel 1

Compilers generate assembly in the penultimate stage of compilation.

The assembly is processed by an assembler, which generates machine code for subsequent processing by a linker.

@fxm90
fxm90 / Combine-CLLocationManagerDelegate.swift
Last active January 25, 2026 15:00
Playground showing how to convert a delegate pattern to combine publishers.
//
// Combine-CLLocationManagerDelegate.playground
//
// Created by Felix Mau on 30.07.20.
// Copyright © 2020 Felix Mau. All rights reserved.
//
import PlaygroundSupport
import Combine
import CoreLocation