Skip to content

Instantly share code, notes, and snippets.

View michalczukm's full-sized avatar

Michał Michalczuk michalczukm

View GitHub Profile
@michalczukm
michalczukm / perfectelementary.bash
Last active November 4, 2023 01:34
HowTo Install the perfect Elementary-OS
# how to install VB guest additions on Elementary OS
# http://www.binarytides.com/install-virtualbox-guest-additions-elementary-os-luna/
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
@michalczukm
michalczukm / .gitignore
Created August 5, 2015 08:58
WPF projects .gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
@michalczukm
michalczukm / Atom_export_settings.md
Last active September 23, 2023 12:32
Atom: Backup all settings

Export:

  1. Copy from ${user}/.atom:
  • config.cson
  • keymap.cson
  • snippets.cson
  • styles.less
  1. Save installed packages list apm list --installed --bare > packages.list
@michalczukm
michalczukm / merge-objects-with-same-shape.ts
Last active March 25, 2022 08:48
How to type safe merge objects which identical types in TypeScript
type IfEquals<T1, T2, IfEqual = T2, Else = never> = (<
Interim
>() => Interim extends T1 ? true : false) extends <
Interim
>() => Interim extends T2 ? true : false
? IfEqual
: Else;
type Entries<T> = {
[K in keyof T]: [K, T[K]];
@michalczukm
michalczukm / move-exercises-to-ts.sh
Created April 12, 2021 17:07
Moves js exercises files to TS - so now you can do the examples in TS
#!/bin/sh
npm install -D typescript @types/node @types/react @types/react-dom @types/jest
echo "{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
@michalczukm
michalczukm / move-to-ts.sh
Created April 12, 2021 14:46
Move the ts files to js, and add ts-nocheck
for f in src/exercise/*.js; do sed -i '' '1s/^/\/\/ @ts-nocheck\'$'\n/g' "$f"; mv -- "$f" "${f%.js}.tsx"; done
@michalczukm
michalczukm / git-pushing-multiple.rst
Created April 10, 2021 14:30 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@michalczukm
michalczukm / pre-push.sh
Last active December 11, 2020 01:10
Run linter on git pre-push
#!/bin/bash
# add it as `pre-push` file in your repository `.git/hooks folder`
# to test it - run `git push --dry-run`, it might be helpful :)
echo "============================= pre-push started ============================= "
remote="$1"
url="$2"
z40=0000000000000000000000000000000000000000
@michalczukm
michalczukm / intersection-observer-example.html
Created May 17, 2020 17:57
Example of Intersection Observer usage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.item {
background: #FFF;
@michalczukm
michalczukm / vscode-extensions.sh
Last active May 4, 2020 18:22
Visual Studio Extensions list and short script to build installable list
##!/bin/bash
# ======= Generate extensions list by:
#code --list-extensions | while read line; do
# echo code --install-extension $line
#done
# ======== My current extensions listcode --install-extension DSKWRK.vscode-generate-getter-setter
code --install-extension akamud.vscode-theme-onedark
code --install-extension alefragnani.Bookmarks
code --install-extension Angular.ng-template