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
// ==UserScript== | |
// @name Focus MFA | |
// @namespace http://paul.stadig.name/ | |
// @version 0.5 | |
// @description if a page has a single text or password field (usually an MFA page), then focus on it | |
// @author Paul Stadig | |
// @match *://*/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
// @grant none | |
// ==/UserScript== |
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
(defmulti connect (fn [& _] (config :storage :backend))) |
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
(ns stadig.main | |
(:require | |
[stadig.storage :as storage])) | |
(defn -main | |
[& args] | |
;; ... initialize some things ... | |
(let [access-key (System/getenv "AWS_ACCESS_KEY_ID") | |
secret-key (System/getenv "AWS_SECRET_ACCESS_KEY") | |
storage-conn (storage/connect {:backend :s3 |
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
(ns stadig.widget | |
(:require | |
[stadig.storage :as storage])) | |
(defn store-widget | |
[storage-conn widget-name] | |
(storage/put storage-conn | |
"widgets" | |
widget-name | |
(pr-str {:type :widget :name widget-name}))) |
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
(ns stadig.storage | |
(:refer-clojure :exclude [get]) | |
(:require | |
[stadig.storage.azure] | |
[stadig.storage.cloudfiles] | |
[stadig.storage.protocol :as proto] | |
[stadig.storage.s3])) | |
(defn connect | |
[options] |
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
(ns stadig.storage.s3 | |
(:require | |
[aws.sdk.s3 :as s3] | |
[stadig.storage.protocol :as proto])) | |
(defrecord S3Storage | |
[access-key secret-key] | |
proto/IStorage | |
(get [this bucket key] | |
(s3/get-object this bucket key)) |
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
(ns stadig.storage.protocol | |
(:refer-clojure :exclude [get])) | |
(defprotocol IStorage | |
(get [this bucket key]) | |
(put [this bucket key value]) | |
(delete [this bucket key]) | |
(close [this])) | |
(defmulti connect :backend) |
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
(ns stadig.main | |
(:require | |
[stadig.storage :as storage] | |
[stadig.storage.s3 :refer [->S3Storage]])) | |
(defn -main | |
[& args] | |
;; ... initialize some things ... | |
(let [access-key (System/getenv "AWS_ACCESS_KEY_ID") | |
secret-key (System/getenv "AWS_SECRET_ACCESS_KEY") |
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
(ns stadig.widget | |
(:require | |
[stadig.storage :as storage])) | |
(defn store-widget | |
[storage-conn widget-name] | |
(storage/put storage-conn | |
"widgets" | |
widget-name | |
(pr-str {:type :widget :name widget-name}))) |
NewerOlder