Skip to content

Instantly share code, notes, and snippets.

View jhuss's full-sized avatar

Jesus Jerez jhuss

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jhuss on github.
  • I am jhuss (https://keybase.io/jhuss) on keybase.
  • I have a public key ASDPENMXAMRy8SC23xAu_uqVfk82rgDX_3-mVaoHIemRvAo

To claim this, I am signing this object:

JSONDecodeError at /user/profile/credit_cards
Expecting value: line 1 column 1 (char 0)
Request Method: POST
Request URL: http://api.tembici.com.br/user/profile/credit_cards
Django Version: 2.0.13
Python Executable: /opt/projects/venv/temapi/bin/python3
Python Version: 3.5.2
Python Path: ['/opt/projects/venv/temapi/bin', '/opt/projects/temapi', '/opt/projects/venv/temapi/lib/python35.zip', '/opt/projects/venv/temapi/lib/python3.5', '/opt/projects/venv/temapi/lib/python3.5/plat-x86_64-linux-gnu', '/opt/projects/venv/temapi/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/opt/projects/venv/temapi/lib/python3.5/site-packages', '/opt/projects/temapi']
Server time: ********************
@jhuss
jhuss / serialize.py
Created June 19, 2018 15:54
encode file to base64 string
with file_io.open(mode='rb') as f:
encoded = base64.b64encode(f.read())
file_base64 = encoded.decode()
@jhuss
jhuss / Dockerfile
Created June 19, 2018 03:54
Dockerfile: legacy php5.6 + mysql
FROM ubuntu:xenial
ENV DEBIAN_FRONTEND=noninteractive
# Install basics
RUN apt-get update
RUN apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
@jhuss
jhuss / gist:364547cdf21397d7bad0
Created December 15, 2014 04:31
Basic Authorization Request
from base64 import b64encode
from urllib2 import Request, urlopen
request = Request(url)
base64string = b64encode(b'{0}:{1}'.format(self.username_api, self.password_api)).decode("ascii")
request.add_header('Authorization', b'Basic {0}'.format(base64string))
result = urlopen(request)