Skip to content

Instantly share code, notes, and snippets.

View yitsushi's full-sized avatar
🏳️‍⚧️

Victoria (Balazs) Nadasdi yitsushi

🏳️‍⚧️
View GitHub Profile
@yitsushi
yitsushi / covid-19.py
Created March 24, 2020 12:00
covid-19 tracker
import requests
import sys
def check(name, row):
if name is None:
return True
if name == row['country'].lower():
return True
if name == row['countryInfo']['iso2'].lower():
@yitsushi
yitsushi / thrift.rb
Last active May 24, 2019 11:47
Thrift 0.11 | Homebrew
class Thrift < Formula
desc "Framework for scalable cross-language services development"
homepage "https://thrift.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=/thrift/0.11.0/thrift-0.11.0.tar.gz"
sha256 "c4ad38b6cb4a3498310d405a91fef37b9a8e79a50cd0968148ee2524d2fa60c2"
bottle do
cellar :any
sha256 "a26c4c6e39b346dc74c5d29ba271b9f64c537914eb3228e446e0ae2e34fa106b" => :mojave
sha256 "d1c648d84f21b567f1468625523b78d496d49954a3f5f28ce127f3eca7c0e2e4" => :high_sierra
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yitsushi
yitsushi / gist:77115fbe86bb6cea6febe9f19d3c7b70
Created March 14, 2019 10:18
find all dirty/with-unstracked repositories
# ~/git-dirty.function.zsh
# This is a quick function and we don't want to load all the rc files with subshell
function git-is-dirty() {
if [[ "$(git status --porcelain)" == "" ]]; then
return 0
else
return 1
fi
}
@yitsushi
yitsushi / random-note.md
Last active December 18, 2020 02:48
dmenu like tool in tmux

dmenu like tool in tmux

tmux.conf:

bind-key C-d split-window "pmenu"
# for horisontal split use
# bind-key C-d split-window -h "pmenu"`
@yitsushi
yitsushi / pack-unpack.rb
Created January 23, 2019 12:10
(teaching material)
id_list = [123456789, 234567891, 345678912, 456789123, 567891234, 789123456, 891234567, 912345678]
packed = id_list.pack('L*')
string_list = id_list.map(&:to_s).join(' ')
puts "Packed version: #{packed.length} bytes long"
puts "Original:"
p id_list
puts "Bytes to send:"
p packed
@yitsushi
yitsushi / breaches.py
Created January 21, 2019 14:31
Check all the breaches
#!/usr/bin/env python3
import requests
import argparse
import json
"""
Example usage:
# From file
$ breaches --filename my_account_list
@yitsushi
yitsushi / archive.py
Last active January 7, 2019 20:33
Archive files (photos/screenshots/videos etc). I have when I have 1000+ files in a single directory
#!/usr/bin/env python3
import os
from datetime import datetime
from multiprocessing import Pool
def is_image(x):
return x.endswith('.jpg') or x.endswith('.png')
def is_movie(x):
// Single-Click Version:
// 1. Create a bookmark with:
javascript:document.body.addEventListener("click",function(t){for(var e=window.getSelection(),n=e.getRangeAt(0),o=e.anchorNode;0!=n.toString().indexOf(" ");)n.setStart(o,n.startOffset-1);n.setStart(o,n.startOffset+1);do{n.setEnd(o,n.endOffset+1)}while(-1==n.toString().indexOf(" ")&&""!=n.toString().trim()&&n.endOffset<o.length);n.toString().trim();e.focusNode.nodeValue=e.focusNode.nodeValue.replace(n.toString().trim(),"***")});
// 2. Place your bookmark on your bookmarks bar
// 3. Push the button when you want to censor your name / anything else
// 4. Click on the word you want to hide
// Double-Click Version:
javascript:document.body.addEventListener("dblclick",function(t){for(var e=window.getSelection(),n=e.getRangeAt(0),o=e.anchorNode;0!=n.toString().indexOf(" ");)n.setStart(o,n.startOffset-1);n.setStart(o,n.startOffset+1);do{n.setEnd(o,n.endOffset+1)}while(-1==n.toString().indexOf(" ")&&""!=n.toString().trim()&&n.endOffset<o.length);n.toString().trim
@yitsushi
yitsushi / homebrew-news.sh
Created March 5, 2018 11:45
homebrew-news is a simple shell script to list changes in Formulas, for example spotting new apps, renamed or deleted Formulas.
#!/bin/bash
days=${1:-1}
current_dir=$(pwd)
homebrew_prefix=$(brew --prefix)
for formula_dir in $(find ${homebrew_prefix}/Homebrew/Library/Taps -name "Formula" -type d); do
cd $formula_dir