Skip to content

Instantly share code, notes, and snippets.

View srusskih's full-sized avatar

Serhii Ruskykh srusskih

View GitHub Profile
srusskih / English all 1-grams
Created May 1, 2024 18:49 — forked from Kroid/English all 1-grams
Google Books Ngrams
In [1]: collector = {}
In [2]: def _generator(collector):
...: for i in range(10):
...: collector.add(i*2)
...: yield i
In [3]: collector = set()
#!/bin/env bash
CONTAINER_ID=$(docker ps | grep $NAME | awk '{printf $1;}')
docker exec -it $CONTAINER_ID bash
srusskih / Spacevim.init.toml
Created December 16, 2022 15:38 — forked from masihtehrani/Spacevim.init.toml
spacevim golang ide
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at >
# URL:
# License: GPLv3
lint_on_the_fly = true
srusskih /
Created April 14, 2020 11:30 — forked from ryu1kn/
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace script with tools like step.

If you just want to get an access token for a service account,

srusskih /
Last active September 13, 2018 14:06
import collections
a = [(i, i - 1) for i in range(10000)]
def t1():
d = collections.defaultdict(lambda: [].append)
for i in a:
srusskih / disable mcafee endpoint
Created September 7, 2018 08:25 — forked from tegansnyder/disable mcafee endpoint
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas


sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
srusskih / gist:e412d17a56936b9fa5929f6e50557f27
Created October 3, 2017 12:28 — forked from dwins/gist:1790448
Pylint rc file to identify functions, classes, and modules without docstrings
# Specify a configuration file.
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
# Profiled execution.
# Shoud be included in ``.bashrc``
function _makefile_targets {
local curr_arg;
local targets;
# Find makefile targets available in the current directory
if [[ -e "$(pwd)/Makefile" ]]; then
targets=$( \
import httplib2
from googleapiclient.http import HttpMock
class OAuth2Credentials:
def set_store(self, store):