Skip to content

Instantly share code, notes, and snippets.

@speto
speto / README.md
Created March 23, 2022 14:40
intellij or vscode as git editor

IntelliJ or Visual Studio Code as a git editor

Permanent setup for git:

config --global core.editor "webstorm --wait"
config --global core.editor "code --wait"

Ad-hoc usage with git commands:

@speto
speto / README.md
Last active January 26, 2022 19:38
Activate/Deactivate Touch ID for sudo in Terminal
@speto
speto / README.md
Last active January 26, 2022 19:36
Execute shell script directly from a URL or create shell command line installation script (macOS)

Execute shell script directly from a URL or create shell command line installation script (macOS)

non-sudo

zsh -c "$(curl -sL https://gist.githubusercontent.com/speto/89c741391b5283e3071938f4d4d61553/raw/whoami.sh)"

or

zsh <(curl -sL https://gist.githubusercontent.com/speto/89c741391b5283e3071938f4d4d61553/raw/whoami.sh)
@speto
speto / conditions.php
Created November 21, 2018 18:12
evaluation of callable conditions POC
<?php
class IsTrue
{
public function __invoke()
{
return true;
}
}
@speto
speto / install-quake3+cpma.sh
Last active May 17, 2024 15:27 — forked from nikhilmetrani/install-quake3+cpma.sh
Install Quake 3: Arena + CPMA on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@speto
speto / git-deletebranches.sh
Last active August 14, 2017 12:47 — forked from zasadnyy/git-deletebranches.sh
Git Delete Merged Branches
#!/bin/bash
MAIN=master
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|develop\|\*')
echo Branches merged into $MAIN:
echo $BRANCHES | tr " " "\n"
read -p "Delete these branches (y/n)? " answer
@speto
speto / Timer.js
Last active May 2, 2016 13:49
Stopwatch inspired by https://tracy.nette.org/en/#toc-timing and iPhone's stopwatch for measuring duration in JS
var Stopwatch;
(function (console) {
function createWatches() {
var watches = {};
function start(label) {
label = label || "";
watches[label] = new Date().getTime();
@speto
speto / access-arguments-zsh.md
Last active May 2, 2016 14:12
How to access arguments in Zsh

Access arguments in Zsh

$ ls jeden dva tri

Shortcut

echo Esc. => echo tri

Second argument

$ grep bar !:2
@speto
speto / refreshDockIcon.md
Last active May 2, 2016 14:13
How to refresh OS X dock icon for specific application

If you only want to update one Application icon, ie, in App.app/Contents/Resources/App.icns just touch the App.app folder. (I've read you need to do the Info.plist as well sometimes, although I've never needed to.)

Close the finder windows and:

touch /Applications/App.app
touch /Applications/App.app/Contents/Info.plist

You can refresh the dock icon cache using the commands above, also do a killall Dock to restart it. Personally I would just drag the application in question, off the dock and re-start / keep in dock, because this is generally a one off thing. As always, script it if possible / and you're doing it a lot.

source: https://gist.github.com/fabiofl/5873100#gistcomment-1320553