Not sure what these are:
datasette ~/Library/Suggestions/*.db
Safari stuff:
datasette ~/Library/Safari/*.db
Your desktop background:
var page = require('webpage').create(), | |
address, output, size; | |
if (phantom.args.length < 2 || phantom.args.length > 3) { | |
console.log('Usage: rasterize.js URL filename'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
page.viewportSize = { width: 1280, height: 1024 }; |
function onOpen() { | |
var ui = DocumentApp.getUi(); | |
ui.createMenu('Convert to .RST') | |
.addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText') | |
.addToUi(); | |
} | |
// Adopted from https://github.com/mangini/gdocs2md by Renato Mangini | |
// License: Apache License Version 2.0 | |
String.prototype.repeat = String.prototype.repeat || function(num) { |
With the OS X firewall enabled, you can remove the "Do you want the application "python" to accept incoming network connections?" message. | |
Create a self-signed certificate. | |
Open Keychain Access. Applications > Utilities > Keychain Access. | |
Keychain Access menu > Certificate Assistant > Create a Certificate... | |
Enter a Name like "My Certificate". | |
Select Identity Type: Self Signed Root | |
Select Certificate Type: Code Signing | |
Check the Let me override defaults box |
[ | |
{ | |
"date": "Mon Jan 23 13:03:00 2017 -0800", | |
"message": "Recommended by Django https://docs.djangoproject.com/en/1.10/ref/databases/#setting-sql-mode", | |
"title": "SET sql_mode='STRICT_TRANS_TABLES';", | |
"hash": "a395f401c9a6d3e8602b80ecc729d736da871f46", | |
"author": "Simon Willison <[email protected]>" | |
}, | |
{ | |
"date": "Mon Jan 23 11:37:38 2017 -0800", |
Not sure what these are:
datasette ~/Library/Suggestions/*.db
Safari stuff:
datasette ~/Library/Safari/*.db
Your desktop background:
I needed to add CORS headers so that client-side JavaScript could upload images directly to an S3 bucket.
I used the Amazon S3 console tool https://console.aws.amazon.com/s3/home?region=us-east-1#&bucket=name-of-bucket&prefix=
Permissions -> Add CORS Configuration
<link rel="stylesheet" href="http://leaverou.github.io/awesomplete/awesomplete.css"> | |
<script src="http://leaverou.github.io/awesomplete/awesomplete.js"></script> | |
<script> | |
document.addEventListener('DOMContentLoaded', () => { | |
const input = document.querySelector('input.blah'); | |
const awesomplete = new Awesomplete(input); | |
input.addEventListener("awesomplete-selectcomplete", (ev) => console.log(ev.text)); | |
input.addEventListener('keyup', (e) => { | |
var code = (e.keyCode || e.which); | |
if (code === 37 || code === 38 || code === 39 || code === 40 || code === 27 || code === 13) { |
#!/usr/bin/env python | |
import re | |
import os | |
import urlparse | |
import hashlib | |
import json | |
import sys | |
title_re = re.compile(r'([=*]{3,})\n([^\n]+)\n\1\n') |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
var authExpirationHandler, | |
errorHandler; | |
function catchUnauthorizedResponses(data) { | |
if (data.status === 401 && !maybeLocalStorage.getItem("token")) { | |
// ensure the in-memory session really is expired before destroying it | |
return axios.get("/api/auth/session").then( | |
(response) => { | |
// we ARE still auth'd, so just throw the error down the chain | |
throw data; |