Skip to content

Instantly share code, notes, and snippets.

View danielbayley's full-sized avatar
👨‍💻
Working on too many things…

Daniel Bayley danielbayley

👨‍💻
Working on too many things…
View GitHub Profile
@danielbayley
danielbayley / package-schema.yaml
Last active February 15, 2024 18:16
@npmjs `package.json` schema.
# TODO https://gist.github.com/danielbayley/2e22371a0818af67ae93103524f7e0cf
# https://docs.npmjs.com/cli/configuring-npm/package-json
$schema: http://json-schema.org/draft-07/schema #
$id: https://json.schemastore.org/package #.json
title: JSON schema for NPM package.json files
definitions:
person:
description: A person who has been involved in creating or maintaining this package.
type:
@danielbayley
danielbayley / template.svg
Last active August 7, 2023 18:41
Preview SVGs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielbayley
danielbayley / seticon.swift
Created February 25, 2023 15:27
Set icon for file or folder from image, existing app or folder.
#! /usr/bin/xcrun swift
import Cocoa
let args = CommandLine.arguments[1...]
let (target, icon) = (URL(fileURLWithPath: args.first!).path, args[2])
var folder: ObjCBool = false
FileManager.default.fileExists(atPath: icon, isDirectory: &folder)
let image: NSImage = folder.boolValue
// Crypto Expansion Pack - Numi.io
numi.addUnit({
"id": "wei",
"phrases": "wei, Wei",
"baseUnitId": "ETH",
"format": "Wei",
"ratio": 1e-18,
});
@danielbayley
danielbayley / starcraft-mass-recall.rb
Last active August 13, 2021 18:34
@Homebrew formula for StarCraft: Mass Recall
cask "starcraft-mass-recall" do
version "8.0.1"
sha256 "76750def5b63cf58afeb63e9948b5efec23adb436964eb730fe5d800d5a89e3b"
resources = {
mod: ["3246208", "SCMR_v#{version}.zip"],
assets: ["3239552", "SCMRassets_v#{version}.zip", "9277d51c89e3cc473a3b5d588c2f3cdb"],
cinematics: ["2819339", "SCMRcinematics_v7.2.zip", "f19ea12979eb8eaf703ed00ef33b7912"],
redux: ["3246278", "Enslavers_Redux_v#{version}.zip", "b61129ef7df2004faa4c08480e447f31"],
}
format_version: 4
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
#project_type: macos
trigger_map:
- push_branch: '*'
workflow: test
- pull_request_target_branch: '*'
workflow: test
@danielbayley
danielbayley / basic.css
Last active November 6, 2022 19:50
Reset CSS
html:focus-within { scroll-behavior: smooth }
footer {
position: sticky;
top: 100vh
}
@danielbayley
danielbayley / gem.zsh
Last active May 16, 2020 00:25
A shim for @rubygems to make gem install behave more like @npm.
#! /bin/zsh -f
#alias -g i=install
#RUBY_VERSION=`ruby -e 'print RUBY_VERSION'`
#export PATH=$PATH:ruby/$RUBY_VERSION/bin:$GEM_HOME/bin
gem () {
case $@ in
install*-g*) command gem install ${@:3};;
install*) command gem install ${@:2} --install-dir=ruby/$RUBY_VERSION;;
rm*) command gem uninstall $@;;
@danielbayley
danielbayley / anka.command
Last active May 16, 2020 00:27
A shim for anka[-flow] by @veertuinc.
#! /bin/zsh -f
alias vm=anka
if (which -s anka) vm () {
set -- ${${@/ls/list}/-h*/--help}
case $@ in
view*) command anka start ${@:2} && command anka $@;;
l*s*img*) command anka "list${=*/*img/-images}";;
reg*) command anka registry ${@:2};;
*) command anka $@;;
esac
@danielbayley
danielbayley / gitkraken.command
Last active July 6, 2019 04:27
A CLI for GitKraken
#! /bin/zsh -f
argv=${1:-$PWD}/
if ([ ! -d $1.git ]) return
pkill -9 GitKraken
open -a $_ --args --path $1