Skip to content

Instantly share code, notes, and snippets.

View antikytheraton's full-sized avatar
💻
configuring nvim

Aaron Arredondo antikytheraton

💻
configuring nvim
View GitHub Profile
@antikytheraton
antikytheraton / 01_utils.py
Created July 12, 2018 14:46 — forked from mbrochh/01_utils.py
Using pagination with Django, graphene and Apollo
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
# First we create a little helper function, becase we will potentially have many PaginatedTypes
# and we will potentially want to turn many querysets into paginated results:
def get_paginator(qs, page_size, page, paginated_type, **kwargs):
p = Paginator(qs, page_size)
try:
page_obj = p.page(page)
except PageNotAnInteger:
@antikytheraton
antikytheraton / response.json
Created May 31, 2018 08:52
get my requests
{
"sent": [
{
"id": 2,
"profile": {
"nickname": "Foo03 Foo04 Swinger",
"picture": "https://assets.trome.pe/files/ec_article_multimedia_gallery/uploads/2018/04/17/5ad609d27c1a7.jpeg"
}
},
{
@antikytheraton
antikytheraton / response.json
Created May 31, 2018 05:01
Get my single profile
{
"single": {
"profiletype": 0,
"nickname": "foo10",
"picture": "https://foo34.jpg",
"country": "México",
"spot": "Aguascalientes",
"city": "Aguascalientes",
"country_born": "México",
"give_oral": "2",
{
"single": null,
"couple": {
"id_person_one": {
"profiletype": 0,
"nickname": "foo08",
"picture": "https://foo34.jpg",
"country": "México",
"spot": "Aguascalientes",
"city": "Aguascalientes",
@antikytheraton
antikytheraton / unknown.json
Last active May 26, 2018 01:13
Visit profile - unknown
{
"object_type": "profile",
"friends": false,
"friendship_pending_request": true,
"already_verified": false,
"photos": [],
"verifications": [],
"friendships": [],
"profile_data": {
"id": 7,
@antikytheraton
antikytheraton / known.json
Last active May 26, 2018 01:14
Visit profile
{
"object_type": "profile",
"friends": true,
"friendship_pending_request": false,
"already_verified": false,
"photos": [
{
"url": "https://www.omniitworld.com/img/team5.jpg"
}
],
@antikytheraton
antikytheraton / fblogin_test.py
Created December 8, 2017 21:49 — forked from adoc/fblogin_test.py
py: Simple facebook login
import os
import base64
import flask
import urllib.parse
import requests
app = flask.Flask(__name__)
APP_ID = "ID"
APP_SECRET = "SECRET"
@antikytheraton
antikytheraton / fblogin.py
Created December 8, 2017 21:46 — forked from chm0815/fblogin.py
Facebook Login Script
import sys, urllib, urllib2, cookielib
class FacebookLogin(object):
def __init__(self,user,passw):
self.user=user
self.passw=passw
self.browser = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookielib.CookieJar()))
self.browser.addheaders=[('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0')]
urllib2.install_opener(self.browser)
#!/home/drspock/scripts/FBInvite/bin/python
import argparse
import requests
import pyquery
def login(session, email, password):
'''
Attempt to login to Facebook. Returns user ID, xs token and
@antikytheraton
antikytheraton / gist:a35b87b7ec7845e0d71a047a6208e217
Created November 24, 2017 01:14 — forked from cdrx/gist:6952891
Django user registration with a custom user model via a Django REST Framework request
from django.contrib.auth import get_user_model
from rest_framework import status, serializers
from rest_framework.decorators import api_view
from rest_framework.response import Response
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()