Skip to content

Instantly share code, notes, and snippets.

@MikeGajdos
MikeGajdos / themeToggle.js
Created September 20, 2021 18:21
Dark Mode Rises
// components/themeToggle.js
//...
<ToggleButton
type="button"
onClick={() => setActiveTheme(inactiveTheme)}
>
@dmontagu
dmontagu / bootstrap-new-mac.sh
Created August 10, 2020 08:23
Bootstrap a new mac
#!/usr/bin/env bash
# This bootstraps installing ssh-keys to github
# set colors
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
ORANGE="$(tput setaf 172)"
else
@mrpnelson
mrpnelson / mac-wipri.sh
Last active November 16, 2022 15:22
Mac WiFi Preferred Network Refresh Script
#!/bin/bash
# ------------------------------------------------------------------------------------------
# May 4, 2021 Update
# This is maintained here for reference, but it seems like the networksetup script
# is capable of doing this, at least in Big Sur. I haven't tested this on older versions.
# See https://gist.github.com/mrpnelson/c65302efed6c18300fb28c8da87bc69a#gistcomment-3731567
# for details on using the native tooling
# ------------------------------------------------------------------------------------------
@tuckerconnelly
tuckerconnelly / mac-setup.sh
Last active May 20, 2021 12:43
macOS New Setup Script
# I like to start fresh with a new mac, instead of using the Migration Assistant, because of all the cruft
# and useless software that may have accumulated.
#
# This script sets ups macs the way I like as a mostly JavaScript and Python developer. Feel free to copy
# and edit it as you see fit.
#
# Depends on a .env.sh file that sets up aliases here:
# https://gist.github.com/tuckerconnelly/2e69cbd3c6432c815e733f45c5827ad7
@ShawInnes
ShawInnes / setup.sh
Last active January 31, 2023 09:57
New Mac Setup
#!/bin/sh
touch ~/.zprofile
COMPNAME="Titan"
sudo scutil --set ComputerName "$COMPNAME"
sudo scutil --set HostName "$COMPNAME"
sudo scutil --set LocalHostName "$COMPNAME"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPNAME"
@vforge
vforge / appify.sh
Created November 27, 2017 16:02
appify -- convert your non-interactive shell script into a Mac OS X application
#!/bin/bash
# source: https://git.abackstrom.com/appify.git/blob_plain/HEAD:/appify.sh
#
# appify -- convert your non-interactive shell script into a Mac OS X application
# Copyright (C) 2010 Adam Backstrom
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
@SleepingInsomniac
SleepingInsomniac / defaults.sh
Created September 29, 2017 04:20
defaults write
echo "Expanding the save panel by default"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
echo "Displaying ASCII control characters using caret notation in standard text views"
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
echo "Disabling automatic termination of inactive apps"
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
@cezaraugusto
cezaraugusto / darkmode.css
Created August 25, 2017 13:52
dark mode for webviews
/** That's it. Thank you. */
filter: sepia(0.9) brightness(0.8);
@anmoljagetia
anmoljagetia / appify
Created August 7, 2017 12:33
Appify script to create MacOS apps from scripts.
#!/usr/bin/env bash
Appify="$(basename "$0")"
if [ ! "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
Appify v5 for Mac OS X
Creates the simplest possible Mac OS X app from a shell script.
Takes a shell script as its first argument:
@luzlab
luzlab / awesomeMacDeveloperSetup.sh
Last active June 11, 2024 18:41
Mac Developer Setup
# Inspired by https://gist.github.com/kevinelliott/7a152c556a83b322e0a8cd2df128235c
##############################################################################
# Install brew and base set of packages
##############################################################################
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# might need to run `sudo chown -R $USER:admin /usr/local` if install fails because of permissions issue.
brew update && brew upgrade