Skip to content

Instantly share code, notes, and snippets.

View udaykadaboina's full-sized avatar
🎯
Focusing

Uday Kadaboina udaykadaboina

🎯
Focusing
View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@donvito
donvito / main.go
Last active February 24, 2025 08:54
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
@elrayle
elrayle / byebug_commands.md
Last active February 3, 2025 13:12
Byebug Cheatsheet - organized by related commands

Byebug Cheatsheet

This cheatsheet includes most of the byebug commands organized by related commands (e.g. breakpoint related commands are together).

To see official help...

Command Aliases Example Comments
help h h list top level of all commands
help cmd h cmd-alias h n list the details of a command (example shows requesting details for the next command) (this works for all commands)
@akshaymohite
akshaymohite / luhn-algorithm-to-validate-card-number.rb
Last active October 10, 2019 22:14
Luhn's Algorithm to validate card numbers
number = "314143525252"
sum = 0
number.reverse.split("").each_slice(2) do |x,y|
sum += x.to_i + (2*y.to_i).divmod(10).sum
end
p sum%10 == 0 ? 'valid card number' : 'invalid card number'
@schweigert
schweigert / Embedding GoLang into a Ruby application.md
Last active October 31, 2024 21:59
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 26, 2025 12:39
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ldez
ldez / gmail-github-filters.md
Last active March 15, 2025 21:57
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@ColCh
ColCh / README.md
Last active September 26, 2024 08:12
Git pre-push hook to confirm pushing to master
@BretFisher
BretFisher / present.zsh-theme
Last active December 27, 2024 18:01
oh-my-zsh theme for presentations (hides prompt features based on path)
# problem: when presenting, I want to obscure
# my prompt to act like it's at root of file system
# and be very basic with no git info, etc.
# solution: this theme lets you set a ENV to the path
# of your presentation, which will help remove unneeded prompt
# features while in that path
# oh-my-zsh theme for presenting demos
# based off the default rubbyrussell theme
@jakub-g
jakub-g / gist:63e9606137557dbdd299
Last active November 3, 2020 20:26
git pre-push hook to check and print how many commits behind origin/master you are
#!/bin/bash
git-log-flat-message-author () {
git log --format="%s %an" "$@"
}
git-log-flat-colored() {
git --no-pager log --format="%C(yellow)%h%Creset %C(cyan)%cd%Creset %s %Cgreen%an%Creset" --date=short "$@"
}
REFERENCE_BRANCH="origin/releases/master"