Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kleber Soares klebercode

🎯
Focusing
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
@klebercode
klebercode / 00_GraphQL_Subscriptions.md
Created Sep 23, 2019 — forked from tricoder42/00_GraphQL_Subscriptions.md
GraphQL Subscriptions with django-channels
View 00_GraphQL_Subscriptions.md

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

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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View jquery-scroll-animate.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stackoverflow help please</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('html, body').animate({
View base.html
{% load static %}
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Agenda de Contatos</title>
View style.css
.container-fluid {
margin: 3rem auto;
max-width: 62%;
}
/* Header */
header {
border-bottom: 1px solid gray;
margin-bottom: 3rem;
@klebercode
klebercode / admin.py
Created Apr 25, 2019 — forked from hakib/admin.py
How to Turn Django Admin Into a Lightweight Dashboard
View admin.py
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField)
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):
View PULL_REQUEST_TEMPLATE.md

Este PR é relacionado a qual issue?

Conectado a #


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

Caso positivo descreva aqui

View ISSUE_TEMPLATE.md

Comportamento Esperado

Comportamento Atual

View start_review.sh
#!/bin/bash
command_exists () {
type "$1" &> /dev/null ;
}
export GITHUB_REPO="user/repo"
export GITHUB_USERNAME=$(cat ~/.githubrc 2> /dev/null | grep user.login | cut -d ":" -f2 | xargs)
export GITHUB_PASSWORD=$(cat ~/.githubrc 2> /dev/null | grep user.password | cut -d ":" -f2 | xargs)
if [ -z "$GITHUB_USERNAME" ]
You can’t perform that action at this time.