Skip to content

Instantly share code, notes, and snippets.

View GiorgioBertolotti's full-sized avatar

Giorgio Bertolotti GiorgioBertolotti

View GitHub Profile
@npretto
npretto / consolelogwithtypeof.code-snippets
Created June 16, 2020 12:00
console log with typeof
{
"console log with typeof": {
"prefix": ["clt"],
"body": ["console.log(\"$0\", typeof $0, $0)"],
"description": "console log with typeof"
}
}
@miquelbeltran
miquelbeltran / pre-push
Created June 4, 2019 07:18
Flutter pre-push hook that runs analyze and test
#!/bin/sh
# To use add to `.git/hooks/`
# Should be named `pre-push`
# Make executable with `chmod +x`
# stash any unstaged changes
git stash -q --keep-index
# run Flutter analyze + test
flutter analyze
@victor-torres
victor-torres / uninstall_shell_integration.sh
Created March 1, 2016 12:51
Uninstalling shell integration from iTerm 2
#!/bin/bash
function die() {
echo "${1}"
exit 1
}
which printf > /dev/null 2>&1 || die "Shell integration requires the printf binary to be in your path."
which sed > /dev/null 2>&1 || die "Shell integration requires the sed binary to be in your path."
@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active May 15, 2024 10:52
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh: