Skip to content

Instantly share code, notes, and snippets.

View wellic's full-sized avatar

Valerii Savchenko wellic

View GitHub Profile
@wellic
wellic / jq-cheetsheet.md
Created August 10, 2023 16:13 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@wellic
wellic / gist:82e885b2e6db543f43b9addea44c380b
Created February 26, 2023 14:14 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@wellic
wellic / README.md
Created January 5, 2023 08:07 — forked from robertpainsi/README.md
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
#!/bin/sh
IN=LVDS-0;
setoff() {
for display in `xrandr | awk '/ disconnected/ {print $1}'`; do
echo "maybe disabling $display";
xrandr --output $display --off;
done;
}
#!/bin/sh
PATH_TO_ACCOUNT="/path/to/account"
PATH_TO_FILE="/path/to/file"
ACCOUNT_NAME="[email protected]"
ISSUER="Somewhere Org"
KEEPASS_PASSWORD="the secret password"
echo "$KEEPASS_PASSWORD" | keepassxc-cli show -a "TOTP Seed" "$PATH_TO_FILE" "$PATH_TO_ACCOUNT" | grep -v "Insert password" | while read i;do echo "otpauth://totp/$ACCOUNT_NAME?secret=$i&issuer=$ISSUER" | qr;done;
@wellic
wellic / multipleGitProfiles.md
Created January 20, 2022 12:31 — forked from Icaruk/multipleGitProfiles.md
How to have multiple profiles on git

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@wellic
wellic / aproducer.py
Created November 15, 2021 09:50 — forked from dabeaz/aproducer.py
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
from pydantic import BaseModel
import inspect
def optional(*fields):
def dec(_cls):
for field in fields:
_cls.__fields__[field].required = False
return _cls
import unittest
from functools import wraps
from unittest import mock
def log(*args, **kwargs):
""" Logging function """
def print_debug(*args, **kwargs):
@wellic
wellic / exampled_json_pg.py
Created October 28, 2021 08:37
Example json postgres
import psycopg2
import json
def main():
with psycopg2.connect("host=localhost port=15432 "
"dbname=mydb user=postgres password=postgres") as conn:
#insertByObject(conn)
#insertByText(conn)
#select(conn)