Skip to content

Instantly share code, notes, and snippets.

View IdanBanani's full-sized avatar

Idan BananI IdanBanani

View GitHub Profile
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active June 3, 2025 01:06
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@EvieePy
EvieePy / music.py
Last active May 30, 2025 09:08
Basic music with playlist support on Rewrite
"""
Please understand Music bots are complex, and that even this basic example can be daunting to a beginner.
For this reason it's highly advised you familiarize yourself with discord.py, python and asyncio, BEFORE
you attempt to write a music bot.
This example makes use of: Python 3.6
For a more basic voice example please read:
https://github.com/Rapptz/discord.py/blob/rewrite/examples/basic_voice.py
@Pulimet
Pulimet / AdbCommands
Last active June 12, 2025 15:43
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@peteristhegreat
peteristhegreat / linux-one-liners.md
Last active September 2, 2023 17:09
Linux notes

Miscellaneous Linux Commands

Introduction

Linux users are expected to interact with the Linux systems quickly and efficiently.

A bare minimum number of commands will get you by, but if you are interested in sharing what works for you, or common/favorite one-liners or pieces of your bash script continue reading.

General Links

@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@wojteklu
wojteklu / clean_code.md
Last active June 12, 2025 16:38
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

#!/bin/sh
IMG=zImage
[ -n "$1" ] && IMG="$1"
binwalk -y gzip -e "$IMG"
mv _"$IMG".extracted/* piggy && rmdir _"$IMG".extracted
if [ -f piggy ]; then
ls -l piggy
[ -f piggy ] && ( strings piggy | grep 'Linux version' )
@demoive
demoive / Bash Notes
Last active July 31, 2020 19:07
Reference for commands/utilities for use in CLI on Unix and Mac OS X
# use:
# .bash_profile - only gets executed for login bash shells
# .bashrc - only gets executed for NON-login bash shells for only NON-login shells
# .profile - gets executed for ANY login shell
# .bash_logout - only gets executed for bash shells after logout
# Sets the prompt:
#PS1='\h:\w \u\$ '
#PS2='> '
@jhult
jhult / hide_linkedin_ads.txt
Last active November 7, 2021 21:05
Hide LinkedIn Ads - Adblock Filters
! Title: Hide LinkedIn Ads
! Last modified: 19 Sep 2019
! Expires: 20 days (update frequency)
! Homepage: https://gist.github.com/jhult/802e89c64c4b6f27a3a9
! Source: https://gist.githubusercontent.com/jhult/802e89c64c4b6f27a3a9/raw/hide_linkedin_ads.txt
! Licence: https://opensource.org/licenses/MIT
! Ad Banner
linkedin.com##.ad-banner-container