Skip to content

Instantly share code, notes, and snippets.

View BrunoBernardino's full-sized avatar

Bruno Bernardino BrunoBernardino

View GitHub Profile
@BrunoBernardino
BrunoBernardino / an-intro-to-showing-appreciation.md
Last active March 1, 2024 07:05
Many ways to show appreciation!
@BrunoBernardino
BrunoBernardino / README.md
Last active October 3, 2021 11:33
Format + Convert iCloud Photos Export (originals, with moments subfolder)

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:

@BrunoBernardino
BrunoBernardino / keybase.md
Last active August 22, 2018 08:05
keybase.md

Keybase proof

I hereby claim:

  • I am brunobernardino on github.
  • I am brunobernardino (https://keybase.io/brunobernardino) on keybase.
  • I have a public key ASCV1iwLOfJXJPpHapEKwT9wF5v5hjoWwTG4KXAr35uC5go

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma https://explorer.blockstack.org/address/1FBJPttYvREtEcw7Vgd9gCZcRteERYuSma
@BrunoBernardino
BrunoBernardino / oauth2-refresh-token.js
Created October 20, 2017 12:22
Webtask for oauth2-refresh-token.
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-access-token.js
Created October 20, 2017 12:27
Webtask for oauth2-access-token.
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 / fields-output.js
Created October 24, 2017 15:10
Webtask for output fields.
module.exports = function(context, cb) {
cb(null, [
{
"key":"name",
"label":"Better Name",
"type":"string"
},
{
"key":"authorId",
"label":"Author",
@BrunoBernardino
BrunoBernardino / fields-input.js
Created October 24, 2017 15:45
Webtask for getting input fields.
module.exports = function(context, cb) {
cb(null, [
{
"key":"authorId",
"label":"Author",
"type":"number",
"required": true,
"helpText": "This is some help, yo!"
}
]);
@BrunoBernardino
BrunoBernardino / recipe-create.js
Created November 13, 2017 17:34
Webtask for recipe-create.
module.exports = function(context, cb) {
cb(null, {
"id":"1",
"createdAt":1471984289,
"name":"name 1",
"authorId":63,
"directions":"directions 1",
"style":"style 1"
});
};
@BrunoBernardino
BrunoBernardino / oauth2-test.js
Created October 20, 2017 10:27
Webtask for oauth2-test.
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, {