Skip to content

Instantly share code, notes, and snippets.

View maksymx's full-sized avatar
🐍
I may be slow to respond.

Maksym L maksymx

🐍
I may be slow to respond.
View GitHub Profile
@shrimo
shrimo / GPTDescriptor.py
Last active October 10, 2023 11:42
an attempt to speed up the calculation of the descriptor when communicating with ChatGPT
#!/usr/bin/python3
# read, akaze and show
import cv2
import multiprocessing
# Function to read video frames
def read_video_stream(video_file, frame_queue):
cap = cv2.VideoCapture(video_file)
@maksymx
maksymx / PASCAL.sublime-build
Last active August 8, 2023 14:21
Sublime Text build system for Pascal project
{
"cmd": ["fpcbuild.bat", "$file"], "quiet": true
}
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 22, 2024 02:05
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@maksymx
maksymx / postgres_jsonb.md
Last active November 12, 2016 18:43
postgres_jsonb.md

Yesterday, I discovered how you can enable jsonb in postgres/psycopg2. Today, I experimented around with how to query the data in json columns. There is documentation, but it wasn’t initially clear to me how the different operations worked.

CREATE TABLE json_test (
  id serial primary key,
  data jsonb
);
@tomysmile
tomysmile / mac-setup-redis.md
Last active May 23, 2024 03:17
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 23, 2024 06:59
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@pavelpatrin
pavelpatrin / line_profiler_decorator.py
Last active September 6, 2023 14:49
Python line profiler decorator
def profile(func):
from functools import wraps
@wraps(func)
def wrapper(*args, **kwargs):
from line_profiler import LineProfiler
prof = LineProfiler()
try:
return prof(func)(*args, **kwargs)
finally:
@feelinc
feelinc / UploadDirS3.py
Last active May 15, 2024 15:02
Upload folder contents to AWS S3
#!/usr/bin/python
import os
import sys
import boto3
# get an access token, local (from) directory, and S3 (to) directory
# from the command-line
local_directory, bucket, destination = sys.argv[1:4]
@andriisoldatenko
andriisoldatenko / parallelism_in_one_line.py
Last active June 5, 2017 12:42
Parallelism in one line
import urllib2
from multiprocessing.dummy import Pool as ThreadPool
urls = [
'http://www.python.org',
'http://www.python.org/about/',
'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html',
'http://www.python.org/doc/',
'http://www.python.org/download/',
'http://www.python.org/getit/',
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule