Send iMessages from the Command Line
Just run the following in your shell:
| class RecursiveFlattenMethod | |
| attr_reader :result | |
| def flatten_nested_arrays(arr, result=[]) | |
| arr.each do |element| | |
| if element.class != Array | |
| result << element | |
| else | |
| flatten_nested_arrays(element, result) | |
| end |
| @@||slack-msgs.com^$document | |
| @@||slack.com^$document |
brew install weechat --with-python --with-perl
pip3 install --upgrade pip setuptools
pip3 install websocket-client
mkdir -p ~/.weechat/python/autoload
wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
cp wee_slack.py ~/.weechat/python/autoload
| <meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/> | |
| <meta name="robots" content="noodp"/> | |
| <link rel="canonical" href="{{ .Permalink }}" /> | |
| <!-- Twitter Card --> | |
| <meta name="twitter:card" content="summary" /> | |
| <meta name="twitter:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" /> | |
| <meta name="twitter:title" content="{{ .Title }}{{ if .IsHome }} - {{ .Site.Params.Tagline }}{{ else }} - {{ .Site.Title }}{{ end }}" /> | |
| <meta name="twitter:site" content="{{ .Site.Params.twitter }}" /> | |
| <meta name="twitter:creator" content="{{ .Site.Params.twitter }}" /> |
| // need to remove extenion in XCode 10.1, or else I get weird encoding errors that corrupt the script file even when using outside of XCode | |
| let myAppleScript = Bundle.main.url(forResource: "say_hello", withExtension: nil)! | |
| // unnecessary catch statements/need some cleanup | |
| func runAppleScriptFromUrl(scriptUrl: URL) { | |
| do { | |
| var errorScriptLoad: NSDictionary? | |
| if let scriptObject = NSAppleScript(contentsOf: scriptUrl, error: &errorScriptLoad) { | |
| var error: NSDictionary? | |
| if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError( |
| if traitCollection.userInterfaceStyle == .light { | |
| print(“Light”) | |
| } else { | |
| print(“Dark”) | |
| } |
| #!/usr/bin/env python3 | |
| # Mostly sourced from https://stackoverflow.com/questions/37585147/unable-to-view-files-in-a-browser-with-python-http-server | |
| from http.server import SimpleHTTPRequestHandler, test | |
| import argparse | |
| class InlineHandler(SimpleHTTPRequestHandler): |
| func swiftUIUrl(link: String, linkText: String) -> some View { | |
| Button(action: { | |
| let myUrl = link | |
| let url: NSURL = URL(string: myUrl)! as NSURL | |
| UIApplication.shared.open(url as URL) | |
| }){ | |
| Text(linkText) | |
| } | |
| } |
| #!/bin/bash | |
| red='\e[91m' | |
| green='\e[92m' | |
| yellow='\e[93m' | |
| magenta='\e[95m' | |
| cyan='\e[96m' | |
| none='\e[0m' | |
| _red() { echo -e ${red}$*${none}; } | |
| _green() { echo -e ${green}$*${none}; } |