Skip to content

Instantly share code, notes, and snippets.

View alazycoder101's full-sized avatar

Lazy coder alazycoder101

View GitHub Profile

Complete Guide to Android Development: Build and Debug Tips

This comprehensive guide covers essential tips and techniques for Android development, including Java environment setup, USB debugging, wireless debugging, and build management.

Setting Up Your Development Environment

Java Version Management with jenv

Managing multiple Java versions is crucial for Android development. Here's how to set it up:

Authenticating AWS CLI: A Comparison of Leapp and aws-vault

In the world of AWS (Amazon Web Services) development, securely managing credentials for the AWS CLI (Command Line Interface) is crucial. Two popular tools that help developers streamline this process are Leapp and aws-vault. This article will compare these tools, focusing on their approach to AWS CLI authentication, installation, configuration, and usage.

Overview

Leapp

Leapp is an open-source, cross-platform application that provides secure access management for cloud accounts. It offers both a graphical user interface and a CLI, supporting multiple cloud providers, including AWS.

@alazycoder101
alazycoder101 / docker-aliases.sh
Created October 20, 2024 22:45 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #

How to Configure OpenVPN to Allow Access to Specific IPs Only

Introduction

OpenVPN is a popular open-source VPN solution that provides secure point-to-point or site-to-site connections. While it's often used to provide full network access, there are scenarios where you might want to restrict VPN users to accessing only specific IP addresses. This article will guide you through the process of configuring OpenVPN to allow connections to a limited set of IP addresses and provide additional advanced configurations.

Prerequisites

  • A working OpenVPN server
  • Root or sudo access to the server
  • Basic knowledge of networking and firewall concepts
// [email protected] while working on [email protected]
describe('setState mock test', () => {
let mockCallback;
let setState;
const receiver = {
state: {
disabled: false,
},
setState(state, callback) {
@alazycoder101
alazycoder101 / show-block.rb
Last active September 12, 2024 18:35
Use Parser::AST to find the block passed into a method in Ruby
# How to use parser to locate the source code of a block in Ruby
# .pryrc
require 'parser/current'
class SafeNodeFinder < Parser::AST::Processor
attr_reader :found_node
def initialize(target_line)
@target_line = target_line

A Deep Dive into Ruby Job Schedulers: Rufus-Scheduler vs Sidekiq-Scheduler

In the world of Ruby programming, job scheduling is a crucial aspect of many applications. Two popular libraries that handle this task are rufus-scheduler and sidekiq-scheduler. This article will explore the features, similarities, and differences between these two scheduling solutions, with a focus on their implementation details and performance characteristics.

Rufus-Scheduler: The Standalone Scheduler

Rufus-scheduler is a pure Ruby gem that allows you to schedule jobs (blocks of code) for later execution. It's a standalone scheduler that doesn't require any external dependencies.

Example

Title: Demystifying Number Overflow and the Anomalies of Floating-Point Arithmetic

Introduction

In the world of computing, numbers are represented and manipulated in ways that may not always align with our intuitive understanding of mathematics. Two common issues that developers and programmers encounter are number overflow and the inaccuracies of floating-point arithmetic, such as why 0.1 + 0.2 might not equal 0.3. This article delves into these topics, explaining the underlying causes and providing practical examples.

Number Overflow: When Numbers Get Too Big

Streamlining the Data Symphony: Enhancing Serialization in Ruby on Rails

In the intricate ballet of web application development, Ruby on Rails often leads the performance with grace. But when it comes to the grand orchestration of large, nested data structures, even the most agile framework can stumble. Let's embark on a journey to refine the process of serializing complex data, like the multi-layered hierarchy of classrooms, students, lessons, exercises, and scores.

Prologue: The Nested Data Conundrum

Picture a vast library where each bookshelf represents a layer of data. The deeper you venture, the more intricate the connections become. Fetching such data in one go can be as daunting as navigating a labyrinth. But fear not, for we have strategies to illuminate the path.

Act I: The Cache – A Treasure Trove of Pre-Rendered Delights