Skip to content

Instantly share code, notes, and snippets.

View AvinashDalvi89's full-sized avatar
🏠
Working from home

Avinash Dalvi AvinashDalvi89

🏠
Working from home
View GitHub Profile
@pankajparkar
pankajparkar / api.service.ts
Last active May 9, 2022 05:30
Storage Service implementation and consumptions
import { Injectable } from '@angular/core';
import { Entity } from '../enums';
import { FleetPosition, Player } from '../models';
import { StorageService } from './storage.service';
@Injectable({
providedIn: 'root'
})
export class ApiService {
@sgtoj
sgtoj / aws_sso.py
Last active October 2, 2024 14:22
AWS SSO Credentials File Updater for AWS SDKs
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active February 21, 2025 08:41
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@alexdebrie
alexdebrie / README.md
Created February 1, 2019 01:59
Using boto3 generate_presigned_post()

Using an S3 presigned POST url.

  1. Copy the generate.py script to your machine.

  2. Update the BUCKET_NAME and KEY_NAME values in the script as needed.

  3. Run python generate.py. It will spit some output like the following:

$ python3 generate.py

#!/bin/sh
# This script will be executed after commit in placed in .git/hooks/post-commit
# Semantic Versioning 2.0.0 guideline
#
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you make incompatible API changes,
# MINOR version when you add functionality in a backwards-compatible manner, and
# PATCH version when you make backwards-compatible bug fixes.

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "pypy3"
@jeffsrepoaccount
jeffsrepoaccount / post-merge
Last active June 30, 2023 09:42
Git post merge hook for auto-tagging release/hotfix branches based off of branch name
#!/usr/bin/env bash
###############################################################################
#
# Automatically detects a merge on to master from a gitflow-style release
# branch, e.g. release-1.1.1-alpha. If the merged branch matches, the major,
# minor and patch versions are determined and a new release tag is created
# locally. If remote origin exists, this tag will automatically be pushed.
#
# In addition to creating a tag, the release branch will automatically be
# merged into the develop branch. If the branch has already been merged this
@chranderson
chranderson / nvmCommands.js
Last active April 24, 2025 18:42
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active April 26, 2025 20:24
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)