Skip to content

Instantly share code, notes, and snippets.

View arita37's full-sized avatar
💭
I may be slow to respond.

PN arita37

💭
I may be slow to respond.
View GitHub Profile
@arita37
arita37 / module_watcher.py
Created April 29, 2016 14:03 — forked from eberle1080/module_watcher.py
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <eberle1080@gmail.com>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""
@arita37
arita37 / roll_ipython_in_aws.md
Created October 28, 2016 07:51 — forked from iamatypeofwalrus/roll_ipython_in_aws.md
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@arita37
arita37 / r_stl.py
Created June 12, 2017 13:49 — forked from andreas-h/r_stl.py
Python-wrapper for R's STL
# -*- coding: utf-8 -*-
import datetime
from numpy import asarray, ceil
import pandas
import rpy2.robjects as robjects
def stl(data, ns, np=None, nt=None, nl=None, isdeg=0, itdeg=1, ildeg=1,
nsjump=None, ntjump=None, nljump=None, ni=2, no=0, fulloutput=False):
@arita37
arita37 / remove_c_style_comments.py
Created January 13, 2018 09:05 — forked from ChunMinChang/remove_c_style_comments.py
Python: Remove C/C++ style comments
#!/usr/bin/python
import re
import sys
def removeComments(text):
""" remove c-style comments.
text: blob of text with comments (can include newlines)
returns: text with comments removed
"""
pattern = r"""
@arita37
arita37 / display_dataframe_quickly.py
Created November 18, 2019 03:59 — forked from treuille/display_dataframe_quickly.py
Workaround: Displaying a dataframe quickly by slicing it.
import streamlit as st
import pandas as pd
import numpy as np
def display_dataframe_quickly(df, max_rows=5000, **st_dataframe_kwargs):
"""Display a subset of a DataFrame or Numpy Array to speed up app renders.
Parameters
----------
df : DataFrame | ndarray
@arita37
arita37 / 1-WSL and Docker for Windows.md
Created May 30, 2020 14:18 — forked from kekru/1-WSL and Docker for Windows.md
Windows 10 Subsystem for Linux combined with Docker for Windows

Using Windows Subsystem for Linux combined with Docker for Windows

Docker CE for Windows

  • Install Docker CE for Windows
  • Go to Docker for Windows Settings -> General and enable Expose daemon on tcp://localhost:2375 without TLS.
    This will enable the Docker remote API for requests, coming from localhost, not from another computer in your network. A TLS secured version is not yet supported in Docker for Windows. See docker/for-win#453 for more information. I also tried a daemon.json file with options tlscacert, tlscert, tlskey and tlsverify, but Docker for Windows crashed on booting.

Install Windows Subsystem for Linux (WSL)

@arita37
arita37 / Demo Scylla Manager with Docker
Created July 5, 2020 13:33 — forked from tzach/Demo Scylla Manager with Docker
Running a demo of a 3 node Scylla cluster, Scylla Manager and Monitoring
# Start a Scylla cluster
########################
docker run --name some-scylla -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0
# Do not use the above --api-address for production. Exposing API IP is not secure.
SEED=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' some-scylla)
echo $SEED
docker run --name some-scylla2 -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED"
docker run --name some-scylla3 -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED"
# The Best Medium-Hard Data Analyst SQL Interview Questions
By Zachary Thomas ([zthomas.nc@gmail.com](mailto:zthomas.nc@gmail.com), [Twitter](https://twitter.com/zach_i_thomas), [LinkedIn](https://www.linkedin.com/in/thomaszi/))
**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page
## Background & Motivation
> The first 70% of SQL is pretty straightforward but the remaining 30% can be pretty tricky.
@arita37
arita37 / BRAG Example.ipynb
Created May 11, 2024 18:02 — forked from mkeywood1/BRAG Example.ipynb
Examples of using BRAG for Balanced Retrieval Augmented Generation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arita37
arita37 / test.py
Last active June 9, 2024 05:12
S3 Lock mechanism
""" Utils for S3
pip install utilmy python-fire
##### Install LocalStack:
pip install localstack
Start LocalStack: Use the following command to start LocalStack with S3 service:
localstack start --services=s3