Skip to content

Instantly share code, notes, and snippets.

View trulyronak's full-sized avatar
🌏

Ronak Shah trulyronak

🌏
View GitHub Profile
@trulyronak
trulyronak / gdb.md
Created February 4, 2021 04:15
GDB Commands

GDB Commands, I made these for when I was taking CSE 127, and realized that they might be useful to more people. I didnn't write everything on this list, and the full list is available in the piazza

command description
p &buf gives u the address of buf
p $ebp gives you the address of ebp
x/wx 0x1234567 gives you the 4 byte word at a specific address (use this with buf and $ebp)
x/10wx you can specify how many words you want
x/nx something replace n with a number (e.g. 4, 8, ...) to get the hex values at n locations, starting at (something) and increasing in increments of 4 bytes. (added by Anon Comp)
@trulyronak
trulyronak / README.md
Last active July 3, 2020 00:20
Adds Optic to Any Existing Strapi Project

To use this, simply run it via curl and sh

cd path/to/existing/strapi/project
curl -L https://gist.github.com/trulyronak/c02b171a6d6812d0a10d5833c173abb7/raw | sh
@trulyronak
trulyronak / installLegume.sh
Last active May 27, 2020 01:21
Install Legume
apt-get update
apt-get install apt-utils apt-transport-https -y
# We trust HTTPS rather than GPG for this repo - but you can config
# GPG signing if you prefer.
cat > /etc/apt/sources.list.d/legume.list << EOF
deb [trusted=yes] https://ronakshah-deb-packages.s3-us-west-1.amazonaws.com codename main
EOF
# and ensure you update the package info on the server
apt-get update
apt-get install legume
INPUT=$1
MY_COMPRESS="mycompress"
SOL_COMPRESS="solcompress"
MY_UNCOMP="myuncomp"
SOL_UNCOMP="soluncomp"
echo "testing compressions"
./build/src/compress --ascii $INPUT $MY_COMPRESS
./solution-compress.executable --ascii $INPUT $SOL_COMPRESS
diff $MY_COMPRESS $SOL_COMPRESS
echo "just diffed compressions"
@trulyronak
trulyronak / index.html
Created September 9, 2018 01:38
MedHacks
<div class="container">
<div class="row">
<h1>This is an app name</h1>
</div>
<div class="row">
<div class="col-8 col-md-8">These are cool stats</div>
<div class="col-4 col-md-4">Sidebars</div>
@trulyronak
trulyronak / .aliases
Last active February 17, 2024 10:52
Awesome Terminal Aliases (Featuring Brilliant Bash)
# fun stuff
alias lenny='echo \_(ツ)_/¯ | pbcopy'
alias tuxsay='cowsay -f tux '
alias fortunes='sh ~/.fortunes.sh'
alias life='figlet 42 | lolcat'
alias lol='while true; do sl; done;'
alias starwars='telnet towel.blinkenlights.nl'
alias fancy='figlet $@'
# to make people confused xD
@trulyronak
trulyronak / sliders.py
Created January 16, 2017 05:40
OpenCV Thresholding Sliders
import cv2 as cv
import sys
minHue = 0
maxHue = 255
if (len(sys.argv) == 3):
print("Usage: " + str(sys.argv[1]) + " <imgpath>")
sys.exit()
// in cell for row
var day : Date?
if (indexPath as NSIndexPath).row >= self.getShiftInSection((indexPath as NSIndexPath).section){
day = self.dateForIndexPath(indexPath)
style how you want and check if your date contains date with predicate
}else{
//style for blank cell
}
@trulyronak
trulyronak / ViewUtilities.swift
Created April 28, 2016 04:35 — forked from feighter09/ViewUtilities.swift
IBInspectable UIView Extensions for Fun and Profit
extension UIView {
@IBInspectable var borderColor: UIColor? {
get { return layer.borderColor.map(UIColor.init) }
set { layer.borderColor = newValue?.CGColor }
}
@IBInspectable var borderWidth: CGFloat {
get { return layer.borderWidth }
set { layer.borderWidth = newValue }
}