Skip to content

Instantly share code, notes, and snippets.


Kleber Soares klebercode

Block or report user

Report or block klebercode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Clone Schema (Postgres)
CREATE OR REPLACE FUNCTION public.clone_schema(
source_schema text,
dest_schema text)
object text;
buffer text;
default_ text;
column_ text;
klebercode /
Created Feb 4, 2020 — forked from nspo/
Custom validation of Django inline formset
class ProductAutochangeInlineFormSet(
forms.inlineformset_factory(ProductAutochangeSet, ProductAutochange, form=ProductAutochangeForm, extra=1)):
def clean(self):
super(ProductAutochangeInlineFormSet, self).clean()
product_pks = []
num_productautochanges = 0
for form in self.forms:
if not form.is_valid():
klebercode / newrelic-heroku.rst
Created Jan 9, 2020 — forked from pydanny/newrelic-heroku.rst
Getting New Relic onto a Heroku Django app
View newrelic-heroku.rst

Get the Python library:

pip install newrelic

Add this to your ProcFile:

web: newrelic-admin run-program python cn_project/ run_gunicorn -b "$PORT" -w 3
klebercode /
Last active Jan 7, 2020 — forked from jhuangtw-dev/
Running Jupyter with pipenv
pipenv install ipykernel jupyter
pipenv shell
python -m ipykernel install --user --name=$(basename $(pwd))
jupyter notebook
# then in UI, switch kernel to the one matching your pipenv shell name

Este PR é relacionado a qual issue?

Conectado a #

Este PR precisa de atenção especial em algum detalhe?

Caso positivo descreva aqui


Comportamento Esperado

Comportamento Atual

klebercode /
Created Sep 23, 2019 — forked from tricoder42/
GraphQL Subscriptions with django-channels

GraphQL Subscription with django-channels

Django channels are official way for implementing async messaging in Django.

The primary caveat when working with GraphQL subscription is that we can't serialize message before broadcasting it to Group of subscribers. Each subscriber might use different GraphQL query so we don't know how to serialize instance in advance.

See related issue

remember_me = forms.BooleanField(required=False, widget=forms.CheckboxInput())
if not self.cleaned_data.get('remember_me'):
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

View jquery-scroll-animate.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Stackoverflow help please</title>
<script src=""></script>
$(document).ready(function() {
$('html, body').animate({
You can’t perform that action at this time.