Skip to content

Instantly share code, notes, and snippets.

View oboje's full-sized avatar
🎯
Focusing

Igor Popov oboje

🎯
Focusing
  • New York
View GitHub Profile
@oboje
oboje / FetchedResultsPublisher.swift
Created September 16, 2022 22:58 — forked from darrarski/FetchedResultsPublisher.swift
Swift-Combine-CoreData-Fetched-Results-Publisher
import Combine
import CoreData
public final class FetchedResultsPublisher
<ResultType>
: Publisher
where
ResultType: NSFetchRequestResult
{
@oboje
oboje / autopart.sh
Created August 10, 2021 11:11 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@oboje
oboje / chiastat
Created May 14, 2021 10:26 — forked from wallentx/chiastat
Dumping chia info to individual items to query via webserver endpoint
#!/usr/bin/env bash
source /home/your/path/to/chia-blockchain/activate
STR=$(chia farm summary | head -8)
FARM=$(chia farm summary | head -8 | sed 's/ /_/g; s/:_/=/g') #jq -Rs '{chia:split("\n")|map(split(": ")|{(.[0]):.[1]}?)}'
ACTIVE=$(pgrep -fa 'chia plots create' | wc -l)
printem() {
echo "Active_Plots=$ACTIVE"
@oboje
oboje / powerstat.sh
Created April 28, 2020 11:59
mac os input voltage stat
#!/bin/bash
b=$(system_profiler SPPowerDataType)
amp=$(echo "$b" | grep 'Amperage (mA):' | cut -d ':' -f 2 | xargs)
volt=$(echo "$b" | grep 'Voltage (mV):' | cut -d ':' -f 2 | xargs)
power=$(($amp * $volt / 1000))
echo "$b" | grep --color=never -A 1 'Battery Information:'
echo "$b" | grep --color=never -A 1 'Amperage (mA)'
echo " Total Power (mW): $power"
echo ""
@oboje
oboje / coreaudio
Last active April 7, 2020 13:39
restarting coreaudio
#!/bin/sh
sudo launchctl stop com.apple.audio.coreaudiod
@oboje
oboje / gist:9eb044a2b3db5a0a9fc2837707d07221
Created October 29, 2019 13:10
Managing iOS simulators via fastlane
irb
require 'fastlane_core/device_manager'
FastlaneCore::Simulator.delete_all_by_version(os_version: "12.4")
version: 2
# TODO: get rid of ios/ in paths
jobs:
build-and-test:
macos:
xcode: "11.0"
steps:
- attach_workspace:
@oboje
oboje / repo-rinse.sh
Created February 19, 2019 14:32 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
ENVS=~/env
PATH_SCRIPTS="/Users/igorpopov/Library/Mobile Documents/com~apple~CloudDocs/Scripts/"
# path
export PATH=~/scripts/:$PATH:~/work/scripts/:$ENVS:$PATH_SCRIPTS
# parse envs
@oboje
oboje / app_install_flow.sh
Last active November 9, 2018 13:10
macOS tools install flow
#!/bin/bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#
sudo gem install fastlane -NV
#
sudo gem install cocoapods
#
gem install xcode-install
#