This is a hacky way to do it, while we wait for a native bridge (I found it in a React Native issue on GitHub.

https://github.com/facebook/react-native/issues/586#issuecomment-90826117

Basically you trigger an event in your parent component by listening to a navigation change in the WebView, and pass the name of a method (or whatever) via the document.title field.

Longer post coming (maybe, I find myself adding stuff on the go 😰)

You will also have to read the following to correctly send all the data you want from the WebView to the parent component.

http://stackoverflow.com/a/26603875/2621748

After spending way too much time figuring out how to upload stuff (like videos and photos) to S3 in React Native with modules written by others (like react-native-uploader or react-native-fs), I decided to fall back to the good old XMLHttpRequest.

Also this is not strictly related to React Native as it can be used anywhere, but it’s where I used recently.

I am using a couple of variables here:

presignedUrl is the destination URL I get from our API (it is a really long string that looks something like the URL I’m putting at the bottom)
filePath is the full path to the file (including file://).
fileType is the mime type of the file (like video/mp4, or image/jpeg).
fileName is the file name with extension (something.jpg).

And then, drumroll, the super simple code snippet:

const xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
  if (xhr.readyState === 4) {
    if (xhr.status === 200) {
      // Successfully uploaded the file.
    } else {
      // The file could not be uploaded.
    }
  }
}
xhr.open('PUT', presignedUrl)
xhr.setRequestHeader('X-Amz-ACL', 'public-read')
xhr.setRequestHeader('Content-Type', fileType)
xhr.send({ uri: filePath, type: fileType, name: fileName })

Presigned URL and simple request explanation inside.

Every real Hipster must have a Hipster Cat, so I had to get mine.

She is also a Hacker Cat and hacks the best codez. This is her brainstorming while hacking some iOS codez.

27411821472_581b2bf256_c

Hipster Cat also teaches me how to hack. I am not as good as Hipster Cat yet. This is her looking away from my ugly codez.

27234256310_cd35a6a111_c

I finally managed to publish my first app both to Play and AppStore (I already submitted Lokali to the Windows Phone store, so I’m now very universal)!

Swipe, the game I wrote a few words about some time ago, is finally available for free on Google Play and Apple’s App Store. Download it and tell me what you think!

And make sure to like Swipe on Facebook, where we’re going to post random Swipe facts and prepare giveaways (stuff like Doges, Swipe t-shirts, in-game swipes and more)!

Stay tuned, there are many new features coming in future updates!

We all probably noticed more than once that PayPal’s got a very bad conversion rate, which usually makes you spend more money than expected, when buying stuff in another currency.

If you are like me and don’t want to spend 30€ instead of 25€ and donate the rest to PayPal because you are buying in a foreign currency, follow the steps below and let your bank manage the currency conversion instead of PayPal.

Your bank’s conversion rate will usually be similar to the one that Google uses when you use it to convert the price.

Click here to read more.

Interesting fact I got from IFLS.

Eigengrau is the shade of black seen by the human eye in complete darkness.

This isn’t any old shade of black, it is precisely #16161D. With no available light to contrast objects against one another, it is possible to be in the presence of items that are darker black without being able to perceive them that way.

I changed the color of a couple of elements around the blog to Eigengrau, just because it’s cool and kind of geeky!

I don’t know if this is true or just something the internet made up, but these “rules” are very real and it is definitely nice to have someone remind us about them every once in a while. Let this someone be me this time.

Bill Gates once gave a speech at a High School about 11 things students did not and will not learn in school.

Rule 1: Life is not fair – get used to it!

Rule 2: The world won’t care about your self-esteem. The world will expect you to accomplish something BEFORE you feel good about yourself.

Rule 3: You will NOT make $60,000 a year right out of high school. You won’t be a vice-president with a car phone until you earn both.

Continue reading

Canon EOS 650D

I recently bought a Canon EOS 650D from ebay and got it a couple of days ago.

It is a really nice camera, the body feels a lot more professional compared to the body of my old 350D and the rotating screen is big and bright, a real pleasure to look to. Also, and I know this has nothing to do with the quality of the camera, the sound that the shutter does when taking a photo is much nicer than the old one 😀

I decided to buy a new camera because the colors that the other body captured were like washed away.. also because the camera is 10 years old, but this is not as relevant as the colors.

I took some photos of the same stuff with both cameras to compare the colors and overall quality. They were not taken professionally, I used the P mode (basically setting the ISO speed only), no tripod to make the same exact picture as people use to do, I just snapped. Also no retouching except reducing the image size to something less huge.

The result was unexpected as the colors are not that much different.. Oh well, I’m still happy for the upgrade! It’s time to do some shooting 🙂

I also need a name for the camera, if you have any suggestion just say it. Yes, I’m talking to you, mr. Nobody.

See the photos

Random Access Memories by Daft Punk

The most recent addition to my music collection is Daft Punk’s latest album called Random Access Memories.

Listen to it and enjoy this kind of weird but definitely enjoyable combination of different music genres gathered in one place. I also suggest you check out the Collaborators series available on the website, as it will give you an idea on how the album was produced.

I think my favorite song is Instant Crush (feat. Julian Casablancas).

My vote: 9/10