Skip to content

Instantly share code, notes, and snippets.

View srusskih's full-sized avatar

Serhii Ruskykh srusskih

View GitHub Profile
@srusskih
srusskih / English all 1-grams
Created May 1, 2024 18:49 — forked from Kroid/English all 1-grams
Google Books Ngrams
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-1.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-2.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-0.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-3.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-4.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-5.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-6.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-7.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-8.gz
http://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-9.gz
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
NAME=$1
CONTAINER_ID=$(docker ps | grep $NAME | awk '{printf $1;}')
docker exec -it $CONTAINER_ID bash
@srusskih
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 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
[options]
lint_on_the_fly = true
@srusskih
srusskih / README.md
Created April 14, 2020 11:30 — forked from ryu1kn/README.md
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 create-jwt-token.sh script with tools like step.

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

@srusskih
srusskih / test.py
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:
d[i[0]](i)
@srusskih
srusskih / disable mcafee endpoint protection.md
Created September 7, 2018 08:25 — forked from tegansnyder/disable mcafee endpoint protection.md
Disable McAffee Endpoint Protection OSX

method 1

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

alternatively

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
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
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
# Shoud be included in ``.bashrc``
function _makefile_targets {
local curr_arg;
local targets;
# Find makefile targets available in the current directory
targets=''
if [[ -e "$(pwd)/Makefile" ]]; then
targets=$( \
import httplib2
from googleapiclient.http import HttpMock
class OAuth2Credentials:
def set_store(self, store):
pass
@classmethod