Skip to content

Instantly share code, notes, and snippets.

View shubham1172's full-sized avatar
⌨️
Clickety-Clack

Shubham Sharma shubham1172

⌨️
Clickety-Clack
View GitHub Profile
@shubham1172
shubham1172 / AnalyzeGitHubWorkflows.py
Created August 7, 2023 15:35
Gist to analyze a workflow's runs on a repo
import datetime
from github import Github
from helper import fetch_jobs
PAT_TOKEN_PATH = "/Users/shubham1172/.pat_token"
DAPR_CLI_REPO = "dapr/dapr"
LOOKBACK_DAYS = 3
# read token from file
with open(PAT_TOKEN_PATH, "r") as f:
@shubham1172
shubham1172 / Benchmark DAPR CLI
Last active March 30, 2022 12:03
DAPR CLI benchmarking with Measure-Command utility
# The time utility has been taken from https://gist.github.com/jpoehls/2206444
. "C:\Users\shubhash\Documents\WindowsPowerShell\time.ps1"
$DAPR_170_BIN="C:\Users\shubhash\Desktop\dapr_windows_amd64\v1.7.0-rc.2\dapr.exe"
$DAPR_160_BIN="C:\Dapr\dapr.exe"
$SAMPLE_SIZE=100
Write-Host "############################"
Write-Host " dapr --version"
Write-Host "############################"
@shubham1172
shubham1172 / RunLocalSqlServer.md
Created June 15, 2021 17:44
Run a local SQL server instance

See https://hub.docker.com/_/microsoft-mssql-server

Pull the latest image

docker pull mcr.microsoft.com/mssql/server

Run the container

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password123" -p 1433:1433 --name localsqlserver -d mcr.microsoft.com/mssql/server:latest
@shubham1172
shubham1172 / script.gs
Created June 26, 2020 10:19
CalendarSyncService
// run this script as a trigger for your events spreadsheet to sync all the events with google calendar
function myFunction() {
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getDataRange().sort(1)
Logger.log("Fetching calendar data...");
// TODO: replace calendarId with actual id
var cal = CalendarApp.getCalendarById(calendarId);
var titles = fetchCalendarTitles(cal);
@shubham1172
shubham1172 / container.py
Last active March 4, 2020 14:01
HydPy February Container Snippet
import os
import sys
import unshare
import random
import string
import cgroups
if len(sys.argv) == 1:
print(f"Usage {sys.argv[0]} cmd args")
sys.exit(1)
@shubham1172
shubham1172 / backup.sh
Created December 8, 2019 11:40
Backup dotfiles
#!/bin/sh
# This script helps me update my dot files regularly
# It exists in my anacrontab as:
#
# @daily 10 setup.backup su -c /home/shubham1172/setup/scripts/backup.sh - shubham1172 >> /home/shubham1172/.anacronlogs 2>&1
cd ${HOME}/setup/
BACKUP=${HOME}/setup/scripts/backup