Skip to content

Instantly share code, notes, and snippets.

View grundic's full-sized avatar

Grigory Chernyshev grundic

  • Good one
  • Zürich
View GitHub Profile
#!/usr/bin/env python
if __name__ == '__main__':
path = '/some/very/long/path/with/data/inside/hello.txt'
subpaths = list()
splitted = path.split('/')
for index, p in enumerate(splitted):
subpath = '/'.join(splitted[:index])
if subpath:
@grundic
grundic / issue_dumper.py
Created July 19, 2017 08:21
JIRA issue dumper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import time
from multiprocessing import Value
from multiprocessing.pool import ThreadPool
class JiraIssueDumper(object):
# This snippet with randomly select one emoji and put it to the beginning of your PS1.
# Just add it to your .bashrc and you'll get new prompt each time!
emojies=(😎 👻 ⛑ 🐶 🌈 🎁 💩)
random_emoji=${emojies[$RANDOM % ${#emojies[@]} ]}
export PS1="$random_emoji \[\033[38;5;33m\]\u\[$(tput sgr0)\]\[\033[38;5;208m\]@\[$(tput sgr0)\]\[\033[38;5;32m\]\A\[$(tput sgr0)\]\[\033[38;5;208m\]:\[$(tput sgr0)\]\[\033[38;5;33m\][\[$(tput sgr0)\]\[\033[38;5;36m\]\w\[$(tput sgr0)\]\[\033[38;5;33m\]]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
@grundic
grundic / scan.md
Last active April 14, 2020 06:31
Scan for wifi networks in osx

Run this command to periodically rescan for specific network SSID:

while :; do \
  clear; echo "${airport_out}"; \
  airport_out=$(airport --scan=<YOUR_SSID> 2>&1 | awk 'NR == 1; NR > 1 {print $0 | "sort -k3"}'); \
done

Keybase proof

I hereby claim:

  • I am grundic on github.
  • I am grundic (https://keybase.io/grundic) on keybase.
  • I have a public key ASBzXSIZrHw8FeHXqtXR8imjSHT0DZvij7KYWULvK6NzjAo

To claim this, I am signing this object: