Skip to content

Instantly share code, notes, and snippets.

View jpbruinsslot's full-sized avatar
👨‍💻

JP Bruins Slot jpbruinsslot

👨‍💻
View GitHub Profile
@jpbruinsslot
jpbruinsslot / pagination.py
Created February 10, 2022 10:14
Remove count django-rest-framework
from rest_framework.pagination import LimitOffsetPagination, remove_query_param, replace_query_param
from rest_framework.response import Response
class CustomPagination(LimitOffsetPagination):
"""
We are creating a custom pagination class here because count
will take too much time to return a value, so we omit is from
the results. Inspired by:
@jpbruinsslot
jpbruinsslot / curl.sh
Created September 17, 2018 09:42
Using stdin and curl with kubernetes
cat [json-file] | kubectl exec [curl-pod] -- curl -XPOST [service-url] -d @-
@jpbruinsslot
jpbruinsslot / close_conn.sql
Last active August 23, 2018 13:33
Close postgres idle connection
-- Get pid
SELECT
pid
,datname
,usename
,application_name
,client_hostname
,client_port
,backend_start
,query_start
@jpbruinsslot
jpbruinsslot / fork.md
Created February 24, 2018 11:50
Keeping a fork up-to-date by using rebase
$ git remote add upstream git://[remote-username]/[remote-project-name].git
$ git fetch upstream
$ git rebase -i upstream/master
@jpbruinsslot
jpbruinsslot / keybase.md
Created February 28, 2015 11:08
Keybase proof

Keybase proof

I hereby claim:

  • I am erroneousboat on github.
  • I am erroneousboat (https://keybase.io/erroneousboat) on keybase.
  • I have a public key whose fingerprint is 4FD7 A028 BDAC E545 A5B4 98AB D442 7DBE B52B D806

To claim this, I am signing this object: