Skip to content

Instantly share code, notes, and snippets.

View documents-design's full-sized avatar
🖨️
Printing manuals

Documents documents-design

🖨️
Printing manuals
View GitHub Profile
@documents-design
documents-design / upload-a-file.MD
Created September 19, 2019 13:29 — forked from ahmadawais/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@documents-design
documents-design / images.sh
Created September 19, 2019 09:28
Prepares images
#!/bin/bash
mogrify -resize 900x -format jpg **/*
jpegoptim --strip-all -m90 **/*
find . -name "*.JPG" -delete
find . -name "*.tif" -delete
@documents-design
documents-design / Readme.md
Last active April 29, 2019 08:47
Retrieve backups from AWS glacier with awscli

Install pip if needed, then aws-cli

sudo apt install python-pip

pip install awscli

aws configure

Entrer les informations de compte (clef secrète, etc)

@documents-design
documents-design / script.js
Last active April 29, 2019 08:42
Copy range formatting across google sheets
/*
https://webapps.stackexchange.com/questions/50409/cell-reference-with-colour-formatting/50623#50623
https://stackoverflow.com/questions/21229180/convert-column-index-into-corresponding-column-letter
*/
function cellString(tl, br) {
return br ? tl + ':' + br : tl;
}
function getCell(sheet, celltl, cellbr) {