Mix.install(
[
{:exgboost, "~> 0.3.1", override: true},
{:nx, "~> 0.6"},
{:exla, "~> 0.5"},
-- Define the events that should trigger the startWorkDay function | |
local startWorkDayEvents = { | |
hs.caffeinate.watcher.systemDidWake, | |
hs.caffeinate.watcher.screensDidUnlock, | |
hs.caffeinate.watcher.screensaverDidStop | |
} | |
-- Function to check if the event should trigger the startWorkDay function | |
local function shouldTriggerStartWorkDay(eventType) | |
for _, startWorkDayEvent in ipairs(startWorkDayEvents) do |
wrap any function in | |
javascript: (function () { | |
// javascript goes here | |
})(); | |
minify and then create a bookmark with the URL as the minified JavaScript | |
// grayscale all images without an alt tag | |
const css = document.createElement("style"); |
#!/usr/bin/bash | |
# zn - as zettell | |
# new export variables EDITOR for your editor and | |
#+ NOTES for your notes folder. | |
main () { | |
note_id=$(date +'%Y%m%d%H%M%S') | |
$EDITOR $NOTES/"$note_id".md | |
} |
#! /bin/env zsh | |
# Install zcomet, if necessary | |
if [[ ! -f ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh ]]; then | |
command git clone https://github.com/agkozak/zcomet.git ${ZDOTDIR:-${HOME}}/.zcomet/bin | |
fi | |
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then |
##### phx live view 0.16 with leex | |
def render(assigns) do | |
~L""" | |
<button class="<%= if @foo && @bar && @baz do %>text-blue-600<% else %>text-red-600<% end %>">hello</button> | |
""" | |
end | |
##### phx live view 0.16 with heex -inline edition |
If you just want to copy-paste this it should "just work", but you'll need to get yarn
set up. Follow the instructions at https://yarnpkg.com/getting-started/install OR just run:
npm install -g yarn
yarn set version berry
yarn install
# this should make a.yarn/
,yarn.lock
, and.pnp.js
If you want to run these outside of the context of a running phoenix server, you can also run the mix tasks, mix assets.install
and mix assets.compile
. They are a copy paste of some the CLI bits but you could abstract them out to point to a config/cmds.exs
or something if you wanted.
#!/bin/zsh | |
dnd_enabled=$(plutil -extract dnd_prefs xml1 -o - ~/Library/Preferences/com.apple.ncprefs.plist | xpath -q -e 'string(//data)' | base64 -D | plutil -convert xml1 - -o - | xpath -q -e 'boolean(//dict/key[text()="enabled"])') | |
echo $dnd_enabled | |
# An output of 1 means Do Not Disturb is enabled, and 0 means it's disabled. |
#!/bin/bash | |
set -euo pipefail | |
#<UDF name="name" label="Node name"> | |
source <ssinclude StackScriptID="1"> | |
#source ./bash.sh | |
echo "Setting up ubuntu user's ssh key" |
defaults read com.apple.ncprefs.plist dnd_prefs
turn on:
defaults write com.apple.ncprefs.plist dnd_prefs -data 62706C6973743030D60102030405060708080A08085B646E644D6972726F7265645F100F646E64446973706C6179536C6565705F101E72657065617465644661636574696D6543616C6C73427265616B73444E445875736572507265665E646E64446973706C61794C6F636B5F10136661636574696D6543616E427265616B444E44090808D30B0C0D070F1057656E61626C6564546461746556726561736F6E093341C2B41C4FC9D3891001080808152133545D6C828384858C9499A0A1AAACAD00000000000001010000000000000013000000000000000000000000000000AE
turn off:
defaults write com.apple.ncprefs.plist dnd_prefs -data 62706C6973743030D5010203040506070707075B646E644D6972726F7265645F100F646E64446973706C6179536C6565705F101E72657065617465644661636574696D6543616C6C73427265616B73444E445E646E64446973706C61794C6F636B5F10136661636574696D6543616E427265616B444E44090808080808131F3152617778797A7B0000000000000101000000000000000B0000000000000000000000000000007C