Skip to content

Instantly share code, notes, and snippets.

View deepwilson's full-sized avatar
🏠
Working from home

Deep Wilson deepwilson

🏠
Working from home
View GitHub Profile
@ozh
ozh / dalle.md
Last active April 10, 2024 18:12
DALL-E prompts inspiration and examples #dalle #dalle2

Prompts

@karthiks
karthiks / wsl-cheatsheet.ps1
Last active July 11, 2024 10:44
WSL 2 CLI Cheat-sheet To Be Run In Powershell
# To list installed distributions
wsl -l
wsl --list
# To list installed distributions along with its running status and wsl config being 1 or 2
wsl -l --verbose
wsl -l -v
# To run a specific distro
wsl -d distro_name
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deepwilson
deepwilson / get_timestamp_ist
Last active February 8, 2019 08:29
Get current timestamp in IST
# Python3
from datetime import datetime
from pytz import timezone
curent_timestamp_ist = int(datetime.now(timezone('Asia/Kolkata')).timestamp())
# Convert to HH:M:SS
import time
curent_timestamp_ist += 19800
time.strftime("%H:%M:%S", time.gmtime(curent_timestamp_ist))
@deepwilson
deepwilson / get_duration.py
Last active October 20, 2018 06:48
Get duration of a video using 'ffprobe'
from subprocess import check_output
import re
file_name = "movie.mp4"
#For Windows
a = str(check_output('ffprobe -i "'+file_name+'" 2>&1 |findstr "Duration"',shell=True))
#For Linux
#a = str(check_output('ffprobe -i "'+file_name+'" 2>&1 |grep "Duration"',shell=True)) a = a.split(",")[0].split("Duration:")[1].strip()
@ericandrewlewis
ericandrewlewis / index.md
Last active June 6, 2024 01:43
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.