Skip to content

Instantly share code, notes, and snippets.

Avatar
_

Ignacio Chiazzo Cardarello ignacio-chiazzo

_
View GitHub Profile
View page_examples_requests.rb
`GET /products?limit=20&page=1` # -> Returns the **first Page**
`GET /products?limit=20&page=2` # -> Returns the **second Page**
`GET /products?limit=20&page=3` # -> Returns the **third Page**
`....`
`....`
View Shopify_Cursor_based_pagination.md
GET https://{shop}.myshopify.com/admin/api/products.json?limit=3  # page 1

#... Response Header 
Link: "<https://{shop}.myshopify.com/admin/api/2019-07/products.json?page_info=hijgklmn&limit=3>; rel=next"
#...


GET https://{shop}.myshopify.com/admin/api/2019-07/products.json?page_info=hijgklmn&limit=3   # page 2
View Stripe_Cursor_Base_Pagination.rb
https://api.stripe.com/v1/charges?limit=3 # page 1
https://api.stripe.com/v1/charges?starting_after=prod_GscR7tGwKBwJ6C&limit=3 # page 2
https://api.stripe.com/v1/charges?starting_after=prod_GscR7tAbCDewJ1&limit=3 # page 3
View key_set_base_pagination.sql
SELECT *
FROM products
WHERE ID > <since_id_param>
ORDER BY ID ASC
LIMIT 100
View schema_instrospection.gql
type __Schema {
types: [__Type!]!
queryType: __Type!
mutationType: __Type
subscriptionType: __Type
directives: [__Directive!]!
}
@ignacio-chiazzo
ignacio-chiazzo / HeapSort.sj
Last active Dec 10, 2018
Implement Heap Sort in JS
View HeapSort.sj
// Testing Gist
var heapSort = function(arr) {
var n = arr.length;
for(var i = Math.floor(n/2) - 1; i >= 0; i--)
heapify(arr, n, i);
for(var i = n - 1; i >= 0; i--) {
swap(arr, 0, i);
heapify(arr, i, 0);
}
View Giphy_Python_Wrapper.py
#pylint: disable-msg=too-many-arguments
from urllib.parse import urlencode
import requests
class GiphyApiException(Exception):
pass
You can’t perform that action at this time.