Skip to content

Instantly share code, notes, and snippets.

View sdwvit's full-sized avatar
🏠
Working from home

Victor Musienko sdwvit

🏠
Working from home
  • noibu.com
  • Toronto, ON, Canada
View GitHub Profile
@sdwvit
sdwvit / quizzes.md
Last active December 10, 2023 00: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 in Canada

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
  • 20/07/2023 No spam / troll / bullying / pushing
@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;
#include <stdio.h>
#include <stdlib.h>
#include <cs50.h>
string INVALID = "INVALID";
string AMEX = "AMEX";
string MASTERCARD = "MASTERCARD";
string VISA = "VISA";
typedef struct {
@sdwvit
sdwvit / mario.c
Last active March 19, 2022 17:41
mario
#include <stdio.h>
#include <stdlib.h>
#include <cs50.h>
int getHeight(void) {
int height;
do {
height = get_int("Height: ");
} while (
const login = 'sdwvit';
const type = {
feat: 'feature',
chore: 'chore',
main: 'maintenance',
fix: 'fix'
};
const pages = {
land: 'landing',
res: 'results',