Skip to content

Instantly share code, notes, and snippets.

View rsohlot's full-sized avatar
🎯
Focusing

rohit sohlot rsohlot

🎯
Focusing
View GitHub Profile
import sys
import os
import re
import importlib
import warnings
is_pypy = '__pypy__' in sys.builtin_module_names
@rsohlot
rsohlot / xrandr.sh
Created June 17, 2021 21:31 — forked from debloper/xrandr.sh
Add system unrecognized but monitor supported resolution in X
#!/bin/bash
# Copyright (c) 2021 Soumya Deb <debloper@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@rsohlot
rsohlot / postgres_queries_and_commands.sql
Created December 18, 2020 15:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
@rsohlot
rsohlot / bird_classifier.ipynb
Created June 21, 2020 11:38
bird_classifier.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/python3
import math
import os
import random
import re
import sys
from math import gcd
from functools import reduce
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsohlot
rsohlot / README.md
Created September 23, 2019 05:57 — forked from soxofaan/README.md
Simple pretty CSV and TSV file viewer.
@rsohlot
rsohlot / optaplanner points
Last active August 13, 2019 16:25
Optaplanner
* Is shadow variable is needed by solver