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
This file contains 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
// ==UserScript== | |
// @name 591 click next and previous with arrow-keyss | |
// @version 1 | |
// @grant none | |
// @match https://*.591.com.tw/* | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { |
This file contains 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
// ==UserScript== | |
// @name 591 click next and previous with arrow-keyss | |
// @version 1 | |
// @grant none | |
// @match https://*.591.com.tw/* | |
// @run-at document-start | |
// ==/UserScript== | |
KeyEvent = (typeof KeyEvent === "object") ? KeyEvent : []; |
This file contains 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
# old config line | |
# set -g status-bg default | |
# replace with the following: | |
set -g status-style bg=default |
This file contains 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/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}; } |
This file contains 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
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) | |
} | |
} |
This file contains 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/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): |
This file contains 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
if traitCollection.userInterfaceStyle == .light { | |
print(“Light”) | |
} else { | |
print(“Dark”) | |
} |
This file contains 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
// 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( |
This file contains 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
<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 }}" /> |
NewerOlder