Skip to content

Instantly share code, notes, and snippets.

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

Ivan Magaš wooglie

🏠
Working from home
View GitHub Profile
lazyYarnAddTypes() {
yarn add $@
for module in $@
do
echo "Trying to install types for $module"
yarn add @types/$module > /dev/null
done
}
@wooglie
wooglie / cheatsheet.md
Last active June 10, 2020 10:03
Make your life easier with keyboard shortcuts

Tabs

cmd + alt + (left & right arrows) go left or right by 1 tab
cmd + n go to tab n tab
cmd + t open new tab
cmd + shift + t open last closed tab
cmd + w close tab
cmd + r reload

Chrome

cmd + d bookmark this page

@wooglie
wooglie / notify.sh
Created July 10, 2020 12:27
If you want to know when some task is over you can simply call this to let you know
# Usage
# some task && notify "The task is over!"
notify() {
osascript -e "display notification \"$@\""
}
@wooglie
wooglie / decorators.js
Last active October 16, 2022 15:17
Example of decorator use in JavaScript
function log(target, name, descriptor) {
const original = descriptor.value;
if (typeof original === 'function') {
descriptor.value = function(...args) {
console.log(`[${original.name}] Arguments: ${args}`);
try {
const result = original.apply(this, args);
console.log(`[${original.name}] Result: ${result}`);
return result;
} catch (e) {
@wooglie
wooglie / linux_service.md
Created February 18, 2022 13:56
Linux service cheat sheet

linux_service

How to make a service in Ubuntu Linux

Save the following at /lib/systemd/system/you_service_name.service:

[Unit]
Description=My First Service
After=network-online.target
@wooglie
wooglie / keybingings.json
Created May 4, 2022 12:26
VSCode key bindings
[
{
"key": "cmd+1",
"command": "workbench.action.openEditorAtIndex1"
},
{
"key": "ctrl+1",
"command": "-workbench.action.openEditorAtIndex1"
},
{
@wooglie
wooglie / runTimes.sh
Created April 29, 2024 23:34
Run a Node.js script for x amount of times, record each output to a file, and report the failure rate
#!/bin/bash
# Check if a number was provided as an argument
if [ $# -eq 0 ]
then
echo "Please provide a number of times to run the script."
exit 1
fi
# Directory where output files will be saved