Skip to content

Instantly share code, notes, and snippets.

@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active October 14, 2024 15:38
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
-- See the most up to date version here where it says "Download the mrc-converter-suite zip archive" https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1
--
-- Exports Safari's saved passwords to a CSV file formatted for use with the convert_to_1p4's csv converter
--
-- Version 1.4
-- mike (at) cappella (dot) us
--
use AppleScript version "2.5" -- runs on 10.11 (El Capitan) and later
use scripting additions
@SukkaW
SukkaW / bookmark-remove-restrictions.min.js
Last active September 25, 2019 17:51
Remove website restrictions
javascript:(function(){var doc=document,body=document.body;with(body.onselectstart=body.oncopy=body.onpaste=body.onkeydown=body.oncontextmenu=body.onmousemove=body.ondragstart=document.onselectstart=document.oncopy=document.onpaste=document.onkeydown=document.oncontextmenu=null,document.onselectstart=document.onkeydown=document.oncontextmenu=document.onmousedown=function(){return!0},document.wrappedJSObject||document)onmouseup=null,onmousedown=null,oncontextmenu=null;for(var arAllElements=document.getElementsByTagName("*"),i=arAllElements.length-1;i>=0;i--){var elmOne=arAllElements[i];with(elmOne.style.userSelect="initial",elmOne.style.pointerEvents="initial",elmOne.wrappedJSObject||elmOne)onmouseup=null,onmousedown=null}body.style.webkitUserSelect="auto!important",body.style.MozUserSelect="normal!important",alert("已经解除右键和复制限制!")})();
@RhetTbull
RhetTbull / Apple Photos database schema 10.12.6
Last active July 21, 2024 06:34
sqlite3 ".schema" of Photos Library.photoslibrary/database/photos.db on 10.12.6
CREATE VIRTUAL TABLE RidList_VirtualReader using RidList_VirtualReaderModule;
CREATE VIRTUAL TABLE Array_VirtualReader using Array_VirtualReaderModule;
CREATE TABLE LiGlobals (modelId integer primary key, keyPath varchar, value varchar, blobValue blob);
CREATE INDEX LiGlobals_keyPath_index on LiGlobals(keyPath);
CREATE VIRTUAL TABLE LiGlobals_VirtualBufferReader using VirtualBufferReaderModule;
CREATE TABLE LiLibHistory (modelId integer primary key, modDate timestamp, eventType varchar, metaSchemaVersion integer, libraryVersion integer, comment varchar);
CREATE INDEX LiLibHistory_eventType_index on LiLibHistory(eventType);
CREATE VIRTUAL TABLE LiLibHistory_VirtualBufferReader using VirtualBufferReaderModule;
CREATE TABLE LiStringAtom (modelId integer primary key, string varchar);
CREATE INDEX LiStringAtom_string_index on LiStringAtom(string);