Skip to content

Instantly share code, notes, and snippets.

View vn-ki's full-sized avatar

Vishnunarayan K I vn-ki

  • IIT Indore
  • Kerala, India
View GitHub Profile
from astropy.time import Time
def convert_dt64_to_Time(dt64):
if dt64.dtype.name in ['datetime64[M]', 'datetime64[Y]']:
dt64 = dt64.astype('M8[D]')
time_string = str(dt64)
precision = 3
if '.' in time_string:
@vn-ki
vn-ki / fdfmdaemon.py
Created June 19, 2020 19:15 — forked from PotatoesMaster/fdfmdaemon.py
A simple daemon implementing freedesktop.org's file manager interface.This interface is used by Firefox download manager to select a downloaded file in the file manager (since Firefox 28).
#!/usr/bin/env python
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License, Version 2, as
# published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
"""
This is a simple daemon implementing freedesktop.org's file manager interface
(http://www.freedesktop.org/wiki/Specifications/file-manager-interface/).
@vn-ki
vn-ki / Instructions.md
Last active February 29, 2024 13:48
Use ranger as chrome file chooser

Use ranger as chrome file chooser

  1. Copy the contents of kdialog to /usr/local/bin/kdialog
  2. Copy the contents of chrome_chooser.py to ~/.config/ranger/plugins/chrome_chooser.py
  3. Optionally map appropriately
  4. Run chrome with XDG_CURRENT_DESKTOP=KDE