Skip to content

Instantly share code, notes, and snippets.

Avatar

Bruno Bernardino BrunoBernardino

View GitHub Profile
@BrunoBernardino
BrunoBernardino / README.md
Last active Oct 3, 2021
Format + Convert iCloud Photos Export (originals, with moments subfolder)
View README.md

I wrote these because the apps and suggestions I tried before lacked either live photos, or the YYYY/MM file structure I wanted to organize my photos.

This requires:

  • Homebrew (or, in Linux, if you're running the conversion there, you need imagemagick 7+, cd Downloads && sudo apt-get install libjpeg-dev libtiff-dev libwebp-dev libheif-dev && wget http://www.imagemagick.org/download/ImageMagick.tar.gz && tar -xzvf ImageMagick.tar.gz && cd ImageMagick-* && ./configure --with-heic=yes --with-webp=yes --with-jpg=yes --with-png=yes && make && sudo make install && sudo ldconfig /usr/local/lib)
  • Node v14+
  • The two files here (I put them in ~/Downloads/)
  • Exporting your iCloud Photos originals, with the moments subfolder. I exported them all to ~/Downloads/iCloud Photos Export.

After having your export:

View an-intro-to-showing-appreciation.md
View blockstack.txt
Verifying my Blockstack ID is secured with the address 1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma https://explorer.blockstack.org/address/1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma
@BrunoBernardino
BrunoBernardino / recipe-create.js
Created Nov 13, 2017
Webtask for recipe-create.
View recipe-create.js
module.exports = function(context, cb) {
cb(null, {
"id":"1",
"createdAt":1471984289,
"name":"name 1",
"authorId":63,
"directions":"directions 1",
"style":"style 1"
});
};
@BrunoBernardino
BrunoBernardino / fields-input.js
Created Oct 24, 2017
Webtask for getting input fields.
View fields-input.js
module.exports = function(context, cb) {
cb(null, [
{
"key":"authorId",
"label":"Author",
"type":"number",
"required": true,
"helpText": "This is some help, yo!"
}
]);
@BrunoBernardino
BrunoBernardino / fields-output.js
Created Oct 24, 2017
Webtask for output fields.
View fields-output.js
module.exports = function(context, cb) {
cb(null, [
{
"key":"name",
"label":"Better Name",
"type":"string"
},
{
"key":"authorId",
"label":"Author",
@BrunoBernardino
BrunoBernardino / oauth2-access-token.js
Created Oct 20, 2017
Webtask for oauth2-access-token.
View oauth2-access-token.js
module.exports = function(context, request, response) {
if (request.method !== 'POST') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('Must be POST request');
}
if (context.body && context.body.grant_type !== 'authorization_code') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('grant_type must be "authorization_code"');
}
@BrunoBernardino
BrunoBernardino / oauth2-refresh-token.js
Created Oct 20, 2017
Webtask for oauth2-refresh-token.
View oauth2-refresh-token.js
module.exports = function(context, request, response) {
if (request.method !== 'POST') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('Must be POST request');
}
if (context.body && context.body.grant_type !== 'refresh_token') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('grant_type must be "refresh_token"');
}
@BrunoBernardino
BrunoBernardino / oauth2-authorize.js
Created Oct 20, 2017
Webtask for oauth2-authorize.
View oauth2-authorize.js
module.exports = function(context, request, response) {
if (request.method !== 'GET') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('Must be GET request');
}
if (context.query.response_type !== 'code') {
response.writeHead(400, { 'Content-Type': 'text/html' });
return response.end('response_type must be "code"');
}
@BrunoBernardino
BrunoBernardino / oauth2-test.js
Created Oct 20, 2017
Webtask for oauth2-test.
View oauth2-test.js
module.exports = function(context, cb) {
if (!context.headers.authorization) {
return cb(403, 'Forbidden');
}
if (context.headers.authorization !== 'Bearer a_token' && context.headers.authorization !== 'Bearer a_new_token') {
return cb(401, 'Unauthorized');
}
cb(null, {