Skip to content

Instantly share code, notes, and snippets.

View tarurar's full-sized avatar
🌏
Working worldwide

Andrei Tarutin tarurar

🌏
Working worldwide
View GitHub Profile
@tarurar
tarurar / github-contributions.sh
Created June 5, 2025 12:00
GitHub CLI script to display a terminal dashboard with your contributions for today, this month, current year, and previous year. Aligned and easy to read. Requires gh CLI with authentication.
#!/bin/bash
# GitHub Contributions Dashboard
# ------------------------------
# This script uses the GitHub CLI (`gh`) and GraphQL API to display
# a concise, well-aligned summary of your GitHub contributions.
#
# It shows:
# - 🔸 Total contributions for the previous year
# - 🔹 Total contributions for the current year

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@tarurar
tarurar / get-index-names.sql
Last active May 7, 2024 11:01
Get SQL Server index names on tables which use particular column name. Useful when column is about to be altered but before that indexes have to be dropped.
select i.name, c.name, i.type_desc
from sys.indexes i
join sys.index_columns ic on ic.index_id = i.index_id and i.object_id = ic.object_id
join sys.columns c on c.column_id = ic.column_id and ic.object_id = c.object_id
where i.object_id = OBJECT_ID(N'table name') and c.name = 'column name'
@tarurar
tarurar / check-deprecated-nuget-packages.sh
Last active May 27, 2023 22:02
Checks for deprecated nuget packages on .NET projects
#!/bin/bash
# Find all .csproj files
csproj_files=$(find . -name "*.csproj")
# List of packages to be excluded, taken from the TeamCity configuration parameter
# Note: The parameter should be a comma-separated list
excluded_packages="%allow.deprecated.packages%"
# Convert the comma-separated list into a pipe-separated list for grep, if it's not empty
@tarurar
tarurar / python-lesson4.py
Created March 19, 2023 13:20
Python lesson 4
from turtle import *
from random import randint, choice
from time import *
# список вопросов для викторины
questions = {
"Сколько классов в начальной школе?": "4",
"На какой реке стоит Санкт-Петербург?": "Нева",
"Какая самая большая страна в мире?": "Россия",
"Сколько месяцев в году?" : "12",
from turtle import *
from random import randint, choice
from time import *
# список вопросов для викторины
questions = {
"Сколько классов в начальной школе?": "4",
"На какой реке стоит Санкт-Петербург?": "Нева",
"Какая самая большая страна в мире?": "Россия",
"Сколько месяцев в году?" : "12",
@tarurar
tarurar / code-lesson3.py
Created March 5, 2023 12:42
Turtle run lesson 3
from turtle import *
from random import randint
from time import *
bob = Turtle()
bob.penup()
bob.goto(-200, 200)
bob.shape("turtle")
bob.color("black")
bob.fillcolor("gray")
@tarurar
tarurar / aws-spapi-reports.cs
Created November 8, 2021 13:19
A piece of code how to authenticate with new Amazon Selling Partner API from .NET (C#)
var resource = "/orders/v0/orders";
var credentials = new LWAAuthorizationCredentials
{
ClientId = clientId,
ClientSecret = clientSecret,
RefreshToken = refreshToken,
Endpoint = new Uri("https://api.amazon.com/auth/o2/token")
};
app.Use((context, next) =>
{
if (!context.Request.Headers.TryGetValue(ForwardedHeadersDefaults.XForwardedHostHeaderName, out var forwarderHost))
{
if (context.Request.Headers.TryGetValue(ForwardedHeadersDefaults.XOriginalHostHeaderName, out var originalHost))
{
context.Request.Headers.Add(ForwardedHeadersDefaults.XForwardedHostHeaderName, originalHost);
}
}
{
"paymentStatus": "",
"id": "",
"orderId": "",
"paymentAsset": "",
"settlementAsset": "",
"paymentRequest": {
"created_at": "",
"exchangeRate": "",
"amount": "",