This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import appex, photos, sys | |
from PIL import Image | |
img = appex.get_image() | |
box = img.getbbox() # left upper right lower | |
width = box[2] - box[0] | |
height = box[3] - box[1] | |
if width > height: | |
size = (width, width) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
on run argv | |
set |command| to "" | |
repeat with parameter in argv | |
set |command| to |command| & " " & parameter | |
end repeat | |
do shell script |command| with administrator privileges | |
end run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# MacSudo, gksudo equivalent for macOS using AppleScript in bash. | |
osascript -e 'do shell script "'"$*"'" with administrator privileges' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <arduino.h> | |
#include <SoftwareSerial.h> | |
#define TEMP_PIN A0 | |
float temp; | |
SoftwareSerial mySerial(D6, D7); // RX, TX | |
void setup() { | |
Serial.begin(115200); // tty.wchusbserial14130 | |
mySerial.begin(4800); // tty.wchusbserial14110 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from asyncer import asyncify | |
from fastapi import HTTPException, Request | |
from slack_sdk.signature import SignatureVerifier | |
from starlette.status import HTTP_403_FORBIDDEN | |
from starlette.types import ASGIApp, Receive, Scope, Send | |
signature_verifier = SignatureVerifier(signing_secret=os.environ["SLACK_SIGNING_SECRET"] |