Skip to content

Instantly share code, notes, and snippets.

View priyanshujain's full-sized avatar
🏠
Socially distancing

PJ priyanshujain

🏠
Socially distancing
View GitHub Profile
@priyanshujain
priyanshujain / check_old_version.py
Created April 18, 2023 02:51
Here's a Python script that you can use to check and replace the Ubuntu version in a GitHub workflow file for all your repositories.
import os
import requests
import base64
# Set your GitHub API token
GITHUB_TOKEN = "GITHUB_TOKEN"
# Set the Ubuntu version you want to replace
old_ubuntu_versions = ["ubuntu-18.04", "ubuntu-20.04"]
@priyanshujain
priyanshujain / gcs_url_sign.py
Created October 17, 2020 10:21
Google Cloud Storage URL Signer
import base64
import datetime
import sys
import time
from hashlib import md5
import requests
from django.conf import settings
import Crypto.Hash.SHA256 as SHA256
@priyanshujain
priyanshujain / gist:3c6eac207302dd17992e5fe4f6e21fbe
Created October 12, 2020 09:53
Remove all trackers from ubuntu
```
sudo apt-get purge ubuntu-report
sudo apt-get purge popularity-contest
sudo service apport stop
sudo nano /etc/default/apport
sudo apt-get purge apport
@priyanshujain
priyanshujain / celery.sh
Created September 28, 2020 14:03 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@priyanshujain
priyanshujain / loader_1.css
Last active August 14, 2020 19:13
CSS loaders with gradient
.loader {
background: linear-gradient(to right, #2f54eb 10%, rgba(255, 255, 255, 0) 80%);
/* Show only 10px from the border */
-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 10px),#fff 0);
width: 150px;
height: 150px;
border-radius: 50%;
position: fixed;
@priyanshujain
priyanshujain / vscode.json
Last active February 12, 2020 10:50
my python vscode setup
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"workbench.editor.highlightModifiedTabs": true,
"files.autoSave": "afterDelay",
"explorer.sortOrder": "type",
"editor.cursorStyle": "block",
"editor.cursorBlinking": "smooth",
"files.trimFinalNewlines": true,
"editor.acceptSuggestionOnEnter": "off",
@priyanshujain
priyanshujain / template.py
Created September 5, 2019 17:01
Python script template
#!/usr/bin/env python
"""
coding=utf-8
Python script template
"""
import logging
logging.basicConfig(level=logging.DEBUG)

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@priyanshujain
priyanshujain / design-systems.md
Last active April 21, 2019 12:43
Top 20 Design Systems

Homepage

Build beautiful, usable products faster. Material Design is an adaptable system-backed by open-source code-that helps… material.io

Shopify Polaris

Our style guide is the blueprint for our design system. It helps us collaborate across disciplines to build a great… polaris.shopify.com

@priyanshujain
priyanshujain / datasharing.md
Created April 17, 2019 18:00
Data Sharing

How to share data with a statistician

This is a guide for anyone who needs to share data with a statistician or data scientist. The target audiences I have in mind are:

  • Collaborators who need statisticians or data scientists to analyze data for them
  • Students or postdocs in various disciplines looking for consulting advice
  • Junior statistics students whose job it is to collate/clean/wrangle data sets

The goals of this guide are to provide some instruction on the best way to share data to avoid the most common pitfalls