Skip to content

Instantly share code, notes, and snippets.

@niktekusho
niktekusho / read-repos.mjs
Last active May 19, 2023 12:12
Quick Node.js script that allowed me to "re-clone" git repositories in different machines. Usage node read-repos.mjs [root directory] > output-script.sh
'use strict';
// Usage: node read-repos.mjs [root directory] > output-script.sh
import { spawn } from 'child_process'
import { log } from 'console'
import { readdir, readFile, access } from 'fs/promises'
import { EOL } from 'os'
import { sep, join } from 'path'
import { argv, cwd, stdout } from 'process'
@niktekusho
niktekusho / npm-init-config.json
Created March 5, 2019 16:18
My npm init configuration which I apply using local-npm-config.
{
"author": {
"name": "Nicola Dal Maso",
"email": "[email protected]",
"url": "https://github.com/niktekusho"
},
"license": "MIT",
"version": "0.0.0"
}
@niktekusho
niktekusho / Profile.ps1
Last active May 20, 2024 06:50
My PowerShell Profile contains mostly aliases to default Windows cmds and some custom functions I use often.
# niktekusho's profile!
# Put this file in ${HOME}\Documents\PowerShell\
# Custom environment vars
# Persist workspace env-var
[System.Environment]::SetEnvironmentVariable('GH_PROJECTS_PATH', "$env:HOME\Documents\Github")
# Custom prompt
@niktekusho
niktekusho / dockerode-example.js
Last active August 23, 2018 15:55
A dockerode example using ES7 features. The script creates and starts a MongoDB container, then waits for 10 seconds and finally stops and deletes the container.
const Docker = require('dockerode');
const localDocker = new Docker();
async function setup(hostPort) {
const mongoContainer = await localDocker.createContainer({
Image: 'mongo:4.0.0',
Hostconfig: {
PortBindings: {
'27017/tcp': [{
@niktekusho
niktekusho / choco.bat
Last active January 15, 2021 16:27
Work dev env (admin cmd/ps required)
choco install -y 7zip dbeaver filezilla git gradle nodejs notepadplusplus vscode
@niktekusho
niktekusho / cr10-ikea-bed-leveling.gcode
Created May 19, 2018 09:28
CR-10 bed leveling script when using Ikea LOTS mirror (30x30)
;Rev 1.0 Initial Release For Cr-10
;All the "orientations" here are based off of the printer facing you with the extruder closest to you and the Z axis on the left
M300 S2000 P1000 ;Make buzzer sound to notify of the beginning of the leveling process "S" is the frequency of the buzzer "P" is duration in milliseconds
M117 Starting. ;Show message on screen
G4S5 ;Wait for 5 seconds, mostly so it gives you some time to acknowledge it
M117 Front left corner. ;Show message on screen
G1 Y020 X020 ; Move the head 10mm from the home position to the left
G0 Z0 ; Move the head down
G4 S20 ;Wait at that position for 20 seconds