Skip to content

Instantly share code, notes, and snippets.

View vinodMS's full-sized avatar
🎯
Focusing

Vinod Sudharshan vinodMS

🎯
Focusing
  • Amsterdam, Netharlands
View GitHub Profile
@dmyersturnbull
dmyersturnbull / groupyby_parallel.py
Last active February 6, 2024 00:43
Performs a Pandas groupby operation in parallel
import pandas as pd
import itertools
import time
import multiprocessing
from typing import Callable, Tuple, Union
def groupby_parallel(
groupby_df: pd.core.groupby.DataFrameGroupBy,
func: Callable[[Tuple[str, pd.DataFrame]], Union[pd.DataFrame, pd.Series]],
num_cpus: int = multiprocessing.cpu_count() - 1,
@bwbaugh
bwbaugh / ec2-ubuntu-16.04-swap.md
Last active September 27, 2019 06:27
EC2 swap file instructions. Gathered from several online articles / blogs / stackexchange.

Can check if you're using swap with sudo swapon --show and free -h.

EBS volume

Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.

  1. Create the EBS volume e.g., 1 GB.
@roliveira
roliveira / collate.py
Last active October 8, 2020 20:41
Crop, split and collate PDFs using pyPdf
import argparse
from pyPdf import PdfFileWriter, PdfFileReader
def create_parsers():
p = argparse.ArgumentParser(
prog='crop',
description='"%(prog)s" crop pdfs',
<template>
<div class="container main">
<section class="section">
<article class="message">
<div class="message-header is-info">
<p>Register Form</p>
</div>
<div class="message-body">
<form ref="form" @submit.prevent="onSubmit">
<b-field
@JustThomas
JustThomas / nginx_remove_double_slashes.md
Created February 4, 2018 17:16
nginx: Remove double slashes from URLs

Put the following directives in your server block. nginx will then redirect URLs with double (or triple or multiple) slashes to the corresponding URL with a single slash.

merge_slashes off;
rewrite ^(.*?)//+(.*?)$ $1/$2 permanent;