Skip to content

Instantly share code, notes, and snippets.

View sdwvit's full-sized avatar
🇬🇧
Dulwich, London

Victor Musienko sdwvit

🇬🇧
Dulwich, London
  • London, UK
View GitHub Profile
@sdwvit
sdwvit / gist:d657bfda2aee63267dbc39b3f074ca5a
Created June 8, 2025 12:53
Fetch grid to chart dependency version map using github api / git history
const https = require('https');
const fetch = require('node-fetch');
// Function to fetch commit SHAs for a specific file URL from GitHub API with pagination support
async function getCommits(fileUrl, owner, repo) {
const apiUrlTemplate = `https://api.github.com/repos/${owner}/${repo}/commits?path=${fileUrl}&per_page=100&page={page}`;
let allCommits = [];
let page = 1;
let hasMorePages = true;
@sdwvit
sdwvit / gist:44594c727ac10f53c2e9fc87f1843f5c
Last active May 29, 2025 10:00
Generate git commit message using bash and openai api
#!/bin/bash
# Generate patch for uncommitted changes
patch=$(git diff)
if [ -z "$patch" ]; then
echo "No uncommitted changes found."
exit 0
fi
# Check for the OpenAI API key

Company Logo

Monday, February 10th, 2020

Object: Employment Letter - YourFirst YourLast

To whom it may concern,

The present letter is to confirm that YourFirst YourLast, living at 1234-56 Queen Street West, Toronto, Province of Ontario, M6J 0E0, was employed by Company since November 6th, 2017 until January 17th, 2020 as a Developer. His position was permanent, full-time (40h/week).

@sdwvit
sdwvit / quizzes.md
Last active July 5, 2024 13:26
Canadian citizenship practice questions

Citizenship test practice questions and quizzes

Quiz 1-1

1. Which of the following statement is true?

  • Canada is a Republic
  • Immigrants between the ages of 21 and 54 must learn about voting laws in order to become Canadian citizens
  • Canadians haven't given up anything to protect their way of life
  • Canada has welcomed immigrants for years in order to create a society that is free, just, and affluent
@sdwvit
sdwvit / 1.js
Created January 13, 2023 22:12
leetcode 3sum
/**
* @param {number[]} nums
* @return {number[][]}
*/
var threeSum = function(nums) {
const map = nums.reduce((mem, n) =>{
if (!mem[n]) {
mem[n] = []
}
mem[n].push(n);

Code of Conduct

(UA) IT/Tech Ukrainians:

Changelog:

  • 18/04/2022 Initial version
  • ~20/06/2022 Added clause about official sources
  • 18/08/2022 Add info about offtopic chat / change name
  • 20/11/2022 Removed link to offtopic / add "Conflict of interest" clause
@sdwvit
sdwvit / generate.sh
Created October 30, 2019 19:40
Generate cacheable key for CI depending on versioned files diff
#!/bin/sh
a="$(git diff master... --numstat | awk 'NF==3 {total+=$1+$2} END {printf("%d\n", total)}')" \
if [ "$a" -gt 100 ]
then
echo "bust $(date +%s)" > gitdiff
else
echo "keep" > gitdiff
fi
@sdwvit
sdwvit / gcd.js
Last active October 28, 2020 01:35
let test = [[3, [666, 123, 57, 191919, 2]]];
function gcd(a, b) {
while (true) {
if (a !== 0 && b !== 0) {
if (a > b) {
a = a % b;
} else {
b = b % a;
}
#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>
int A_charcode = 65;
int a_charcode = 97;
int abc_size = 25;
string hash;
bool success = false;