Skip to content

Instantly share code, notes, and snippets.

View nikitabugrovsky's full-sized avatar
🚀

Nikita Bugrovsky nikitabugrovsky

🚀
  • Red Hat Inc.
  • Ra'anana, Israel
View GitHub Profile
#!/usr/bin/env bash
# dependencies:
# - imagemagick
# - xdotool
function screenshot() {
local timestamp=$(date "+%Y-%m-%d_%H-%M-%S")
local path="$HOME/Pictures/screenshot_${timestamp}.png"
for i in $(seq 5); do echo "$(printf '%0.s·' $(seq $i))" && sleep 1; done &&
import -window "$(xdotool getwindowfocus -f)" "${path}"
@nikitabugrovsky
nikitabugrovsky / ps1_git.sh
Last active January 26, 2020 13:07
the script will produce customized colorized prompt string with git integration for your terminal
# .bashrc
# following script produces colorized PS1:
# [user@machine]::[git_repo](branch[changed_files_number]::latest_commit)$
git_branch() {
git rev-parse --abbrev-ref HEAD
}
git_commit() {
git rev-parse --short HEAD
}
module StateMachine
class AuthAgent
def initialize
@state = nil
end
def next_state(klass = Default)
@state = klass.new(self)
@state.describe
@state.change_auth
end
# check if credential-osxkeychain is installed
git credential-osxkeychain
#if not installed
git credential-osxkeychain
# Test for the cred helper
# git: 'credential-osxkeychain' is not a git command. See 'git --help'.
curl -s -O \
https://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain
# Download the helper
curl -H "Authorization: token 0auth token" https://api.github.com/orgs/vcita/members\?filter\=2fa_disabled
{
"message": "Only owners can use this filter.",
"documentation_url": "https://developer.github.com/v3/orgs/members/#audit-two-factor-auth"
}