Skip to content

Instantly share code, notes, and snippets.

View vanities's full-sized avatar
🏠
Mining from home

vanities

🏠
Mining from home
View GitHub Profile
@sindresorhus
sindresorhus / PHImageManager-requestImage-async.swift
Created November 3, 2021 05:46
How to use `PHImageManager#requestImage` with async/await in Swift.
import Photos
struct UnexpectedNilError: Error {}
extension PHImageManager {
func requestImage(
for asset: PHAsset,
targetSize: CGSize,
contentMode: PHImageContentMode,
options: PHImageRequestOptions?
@shaps80
shaps80 / SwiftUI-TextView.md
Last active May 6, 2023 22:17
A SwiftUI view that wraps a UITextView but provides almost all functionality though modifiers and attempts to closely match the Text/TextField components.
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
@mraaroncruz
mraaroncruz / claymore-dualminer-api.md
Last active July 20, 2021 17:34
Ethminer API Docs (lol) and some other miner APIs

EthMan uses raw TCP/IP connections (not HTTP) for remote management and statistics. Optionally, "psw" field is added to requests is the password for remote management is set for miner. The following commands are available (JSON format):


REQUEST: {"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}

RESPONSE:

@troyfontaine
troyfontaine / 1-setup.md
Last active May 3, 2024 10:52
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@ivy
ivy / API.txt
Created July 3, 2017 19:21
Claymore JSON-RPC API documentation (from Claymore v9.6)
EthMan uses raw TCP/IP connections (not HTTP) for remote management and statistics. Optionally, "psw" field is added to requests is the password for remote management is set for miner.
The following commands are available (JSON format):
----------------
REQUEST:
{"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}
RESPONSE:
{"result": ["9.3 - ETH", "21", "182724;51;0", "30502;30457;30297;30481;30479;30505", "0;0;0", "off;off;off;off;off;off", "53;71;57;67;61;72;55;70;59;71;61;70", "eth-eu1.nanopool.org:9999", "0;0;0;0"]}
@motoishmz
motoishmz / osxSetup.command
Last active February 3, 2023 07:47 — forked from rettuce/osxSetup.command
osx setup command. use com.apple.dock.plist
#!/bin/sh
### Desktop & Screen Saver
# Desktopを黒に
echo "Change Desctop Pictures"
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Solid Colors/Black.png"'
# ScreenSaver Kill
echo "Disable screensaver"
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@rasschaert
rasschaert / arch_bootstrap.bash
Last active July 27, 2022 12:43
Shell script that performs the installation of Arch Linux the way I like it.
#!/bin/bash
bootstrapper_dialog() {
DIALOG_RESULT=$(dialog --clear --stdout --backtitle "Arch bootstrapper" --no-shadow "$@" 2>/dev/null)
}
#################
#### Welcome ####
#################
bootstrapper_dialog --title "Welcome" --msgbox "Welcome to Kenny's Arch Linux bootstrapper.\n" 6 60
@nickjacob
nickjacob / systemd-prblm.service
Last active March 17, 2023 16:11
execute arbitrary bash code/variable substitution in systemd units
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}"