Skip to content

Instantly share code, notes, and snippets.

View maptv's full-sized avatar
👨‍💻
Per aspera💪ad astra✨

Martin Laptev maptv

👨‍💻
Per aspera💪ad astra✨
View GitHub Profile
@andris9
andris9 / git-cache-meta.sh
Created March 5, 2012 13:15
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# 2012-03-05 - added filetime, andris9
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 9, 2024 10:23
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@ruario
ruario / dtime.sh
Created October 16, 2023 13:29
Show the current Decimal time or convert from "Standard time" to Decimal time
#!/bin/sh -eu
# Check for -s as an argument and if so convert decimal time to 'standard time'
if [ "${1-}" = '-s' ]; then
if [ -n "${2-}" ]; then
TIME_IN_SECS="$(echo 864*$(echo "$2" | tr -d :)/10 | bc)"
if [ "$(uname -s)" = Darwin ]; then
date -j -f "%s" "$(expr $(date -j -f '%H:%M:%S' '00:00:00' '+%s') + $TIME_IN_SECS)" '+%H:%M'
exit 0
else
date --date="0 today + $TIME_IN_SECS seconds" '+%H:%M'