I like Bluebird as a Promise library because of its speed and features. One of the feature that use a lot is spread
that make it easier when handling with array-returning function in a promise chain. But ES6 promise doesn’t have spread
, so what do you do when you need spread
while using ES6 promise?
- Sep 9, 2016...more
Create "hole" in android view
Jan 9, 2016...moreSo now I’m doing Android development and on my first task was to make a camera view that have on overlay on top of it, but with a hole that acts as a camera vieport or viewfinder. I’ve seen other app have this feature so I thought there must be some tutorial or code snippet that I can learn from out there, and there is, but most of them are not obvious or doesn’t quite fit in with my requirement.
And the search goes on and on, up to the point where I promise myself that if I somehow manage to pull this off I’m going to blog about it. And here it is, the simplest way I find to create a “hole” on an android view.
Combine multiple express middleware
Jul 28, 2015...moreI love express‘s middleware concept, it makes splitting application functionality into small modules and composing them in the routes very easy. But when you want to combine those middlewares into one easy to use function, how do you do it?
Rails, Paperclip, and Fakes3
Oct 29, 2014...moreWhen developing a rails application using paperclip with S3 for storage, you don’t want to literally uploading files to S3. Your app development will be slow and you have to be online to do it, that’s cumbersome. This is where fakes3 gem can help, and here’s how you set it up.
Javascript Array shuffle
Oct 8, 2014...moreJavascript Array has loads of useful function, but still there are some function that I wish were there. One of those function is shuffling an array, rearrange it’s components order in random sequence.
Keyword 'new' di JavaScript
May 3, 2014...moreJika kita membuat suatu
function
di JavaScript, kita bisa memanggilfunction
tersebut dengan atau tanpa keywordnew
, apa bedanya?Backbone.Model tidak memicu event 'change'
May 2, 2014...moreSaya mendapati masalah ini ketika saya bermaksud mengganti nilai attribute dari sebuah backbone model tapi event
change
tidak terpicu. Setelah mencari - cari ternyata solusinya sangat sederhana.Rails, Paperclip, Wkhtmltopdf, & image tag
Feb 11, 2014...moreMembuat file PDF dari html dengan wkhtmltopdf memang susah - susah gampang. Gampang karena dengan gem wicked_pdf dan wkhtmltopdf kita tinggal membuat template html untuk dijadikan file PDF. Susah karena agak sedikit tricky untuk memilih binary wkhtmltopdf yang sesuai.
Ngeblog dengan Cabin.js
Feb 1, 2014...moreCabin.js adalah sebuah generator situs statik yang dibuat dengan JavaScript dan dijalankan diatas node.js.
Rails Routes Gotcha
Jan 28, 2014...moreSekian lama bekerja dengan Rails saya masih menemukan beberapa hal yang cukup mengejutkan.
Rails routes
Di file
config/routes.rb
bukan hal yang aneh kalo kita membuat route tambahan selain RESTFul routes yang di hasilkan oleh generator rails.1
2
3
4
5Rails::Application.routes.draw do
resources :post do
post :share
end
end