Skip to content

Instantly share code, notes, and snippets.

View vgavro's full-sized avatar

Victor Gavro vgavro

View GitHub Profile
@nikoheikkila
nikoheikkila / README.md
Last active May 28, 2024 20:08
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@jasalt
jasalt / instapusher.py
Last active February 24, 2024 03:39
Instapusher - automatic instagram uploads from a directory
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Instapusher. Push images from a directory automatically to Instagram.
# Schedule script with cron eg:
# 0 18 * * * /path/to/instapusher --login <your_username> \
# --password <your_password> --random-delay 30 <dir>
@mahmoud
mahmoud / hashtag.py
Last active May 14, 2021 19:13
hashtag regex in python
import re
# the first group is noncapturing and just ensures we're at the beginning of
# the string or have whitespace before the hashtag (don't want to capture anchors)
# without the fullwidth hashmark, hashtags in asian languages would be tough
hashtag_re = re.compile("(?:^|\s)[##]{1}(\w+)", re.UNICODE)
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 17, 2024 15:54
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%'