Skip to content

Instantly share code, notes, and snippets.

View Cu7ious's full-sized avatar
:octocat:
Back to the US

Sergio Garkusha Cu7ious

:octocat:
Back to the US
View GitHub Profile
@Cu7ious
Cu7ious / bootable-win-on-mac.md
Created September 17, 2024 01:36 — forked from acarril/bootable-win-on-mac.md
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@Cu7ious
Cu7ious / index.js
Created September 12, 2024 05:08
Automates saving files (originally built for pics) imported as a OneTab links
#!/usr/bin/env node
const fs = require("fs");
const http = require("http");
const https = require("https");
const path = require("path");
const readline = require("readline");
// Input file and output directory
const inputFile = "links.txt"; // Input file containing URLs
@Cu7ious
Cu7ious / scaffold-fastAPI.sh
Created August 8, 2024 23:17
FastAPI project scaffolder
#!/usr/bin/env bash
# 1) Keys for package dependencies & help message
# Default value for package dependencies
package="fastapi[standard]"
# Default database
database="none"
# Help message
function display_help() {
@Cu7ious
Cu7ious / README.md
Created February 9, 2024 01:06 — forked from paolocarrasco/README.md
`gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

const sym = '>>|<<';
/**
* Encodes a list of strings to a single string.
*
* @param {string[]} strs
* @return {string}
*/
var encode = function (strs) {
return strs.join(sym);
/**
* @param {number[]} nums
* @param {number} k
* @return {number[]}
*/
const topKFrequent = function (nums, k) {
const freqMap = {};
for (n of nums) {
if (!freqMap[n])
const CHAR_MAP = createAbcMap();
/**
* @param {string[]} strs
* @return {string[][]}
*/
const groupAnagrams = function (strs) {
const map = {};
for (const word of strs) {
/**
* @param {number[]} nums
* @param {number} n
* @return {number[]}
*/
const shuffle = function (nums, n) {
const result = [];
let i = 0;
let j = n;
/**
* @param {string} paragraph
* @param {string[]} banned
* @return {string}
*/
const mostCommonWord = function(paragraph, banned) {
const dict = {};
const bannedSet = new Set(banned);
const arr = paragraph.split(/\W/);
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
const m = new Map();
for (let i = 0; i < nums.length; i++) {
if (!m.has(target - nums[i])) {
m.set(nums[i], i);