Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Subramanya Chakravarthy chakrihacker

🎯
Focusing
View GitHub Profile
@chakrihacker
chakrihacker / gist:21750c87c751c4c40f7ef384fb698be6
Created Feb 22, 2020 — forked from austra/gist:d8f5a1de00f12c253716
Pagination Headers With Kaminari for API
View gist:21750c87c751c4c40f7ef384fb698be6
http://jaketrent.com/post/pagination-headers-with-kaminari/
https://developer.github.com/v3/#pagination
Kaminari provides easy pagination in a rails app. It’s great to use. We’ll make it better by adding a little function to your controllers to provide useful pagination headers.
kaminari pagination
Pagination from Kaminari
View gist:9443149431ac79460d135d9d76bacced

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@chakrihacker
chakrihacker / PanResponder_Overview.js
Created Aug 16, 2019 — forked from teameh/PanResponder_Overview.js
React native PanResponder interface overview
View PanResponder_Overview.js
this._panResponder = PanResponder.create({
// ----------- NEGOTIATION:
// A view can become the touch responder by implementing the correct negotiation methods.
// Should child views be prevented from becoming responder on first touch?
onStartShouldSetPanResponderCapture: (evt, gestureState) => () => {
console.info('onStartShouldSetPanResponderCapture');
return true;
},
You can’t perform that action at this time.