Skip to content

Instantly share code, notes, and snippets.

View mkczarkowski's full-sized avatar
🚢
Shipping products

Marcin Czarkowski mkczarkowski

🚢
Shipping products
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
type Colors = "red" | "green" | "blue";
type HSL = [hue: number, saturation: string, lightness: string];
type ColorPalette = Record<Colors, string | HSL>
const palette = (): Promise<ColorPalette> => new Promise((resolve, reject) => {
resolve({
red: [0, '100%', '50%'],
green: "#00ff00",
blue: [240, '100%', '50%']
#!/usr/bin/env node
var fs = require('fs')
let appPath = process.cwd()
const execSync = require('child_process').execSync
let installedEslintConfig;
execSync(`npm uninstall @sr/spl-angular`)
execSync(`git add .`)
#!/usr/bin/env node
console.log("I was executed from a gist inside the terminal with npx!");
#!/usr/bin/env node
var fs = require('fs')
let appPath = process.cwd()
const execSync = require('child_process').execSync
let installedEslintConfig;
try {
const packageJson = JSON.parse(fs.readFileSync('./package.json'))
#!/usr/bin/env zx
try {
const projectsDir = 'code'
const projectName = argv.n
if (!projectName) {
console.error(chalk.red('Please provide argument -n with project name'))
process.exit(1)
}
@mkczarkowski
mkczarkowski / day-plan.md
Last active January 31, 2022 18:39
This is a template that I use for daily planning in Obsidian. Works best with following plugins: Calendar, Day Planner and Periodic Notes.

<% tp.file.title %>

Rozpoczęcie dnia

Jak zapowiada się nadchodzący dzień?

Czym się martwię? Jak mogę sobie z tym poradzić?

Moje 5 celów na ten dzień:

  • [ ]
@mkczarkowski
mkczarkowski / detect-lcp.js
Created February 21, 2021 17:59
This script let you detect and measure LCP on your website.
new PerformanceObserver((entryList) => {
for (const entry of entryList.getEntries()) {
console.log("LCP candidate:", entry.startTime, entry);
}
}).observe({ type: "largest-contentful-paint", buffered: true });
function collatz(n) {
if (n === 1) {
return 0;
}
if (n % 2 === 0) {
return 1 + collatz(n/2);
} else {
return 1 + collatz(3*n+1);
}
@mkczarkowski
mkczarkowski / launch.json
Last active August 14, 2020 11:36
Visual Studio Code configuration for React/Gatsby projects with Debugger for Chrome
{
"name": "Chrome CRA",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:///./*": "${webRoot}/*",
"webpack:///src/*": "${webRoot}/*",
"webpack:///*": "*",