Skip to content

Instantly share code, notes, and snippets.

View rnag's full-sized avatar

Ritvik Nag rnag

View GitHub Profile
@rnag
rnag / .prettierrc.yaml
Created November 19, 2021 22:40
Preferred Prettier Settings
# See https://prettier.io/docs/en/options.html
printWidth: 70
tabWidth: 4
semi: true
singleQuote: true
trailingComma: 'es5'
bracketSpacing: true
arrowParens: 'always'
endOfLine: 'lf'
@rnag
rnag / metaclasses.py
Last active May 29, 2024 05:08
Field Property Support in Dataclasses, for Python 3.7+
from __future__ import annotations
import builtins
from collections import deque
from dataclasses import field as dataclass_field, Field, MISSING
from logging import getLogger
log = getLogger(__name__)
@rnag
rnag / my_stack.py
Last active May 18, 2023 02:35
AWS CDK - AWS Lambda Asset
# from pathlib import Path # Optional
# Using CDK v2
from aws_cdk import Duration
from aws_cdk.aws_lambda import Function, Runtime
from aws_cdk_lambda_asset.zip_asset_code import ZipAssetCode
# NOTE: Only example usage below (needs some modification)
@rnag
rnag / Dockerfile
Last active August 17, 2022 22:14
Python 3.9 Dockerfile using a Private PyPI Repository
# Ref:
# - https://pythonspeed.com/articles/base-image-python-docker-images/
# - https://github.com/FNNDSC/ubuntu-python3/blob/master/Dockerfile
#
# This Docker image uses the `ubuntu` base image for a slight performance
# improvement as mentioned in the article. At build time, you'll need to pass
# in the PyPI authentication info, as shown below:
#
# docker build -t ${image_tag_name} \
# --build-arg PYPI_URL=${PYPI_URL} \
@rnag
rnag / config.xml
Created December 19, 2017 19:55 — forked from g0t4/config.xml
Module 2 - What am I? Get this job loaded into Jenkins and running, there are two problems you'll encounter. Raw
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
package appx_homescreen.appx;
import android.support.v4.view.MarginLayoutParamsCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;