Skip to content

Instantly share code, notes, and snippets.

Cleyton Pedroza de Almeida cletrix

View GitHub Profile
View osx-openfl-install.sh
# Install Haxe using Brew and set the haxelib path
brew install haxe
haxelib setup /usr/local/Cellar/haxe/lib
# Install lime
haxelib install lime
haxelib run lime setup
# Install lime tools
haxelib install format
@cletrix
cletrix / facebook_leads.md
Created Jun 14, 2017 — forked from tixastronauta/facebook_leads.md
Receiving Facebook Leads on a Webhook
View facebook_leads.md

Receiving Facebook Leads on a Webhook

1 - Create an App

Head over to developer.facebook.com and create an App

2 - Setup the webhook

On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5

@cletrix
cletrix / Makefile
Created May 4, 2017 — forked from nzjrs/Makefile
Python ctypes example
View Makefile
all: test libtest.so testmodule
libtest.so: libtest.c
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc
test: test_main.c libtest.o
$(CC) -o $@ $?
testmodule: testmodule.c
python setup.py build
@cletrix
cletrix / simple_websocket_client.html
Created Feb 5, 2016 — forked from geoffb/simple_websocket_client.html
Super simple websockets client/server using Python. Compatible with the draft 76 challenge/response.
View simple_websocket_client.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@cletrix
cletrix / rest-server.py
Created Jan 11, 2016 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
View rest-server.py
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@cletrix
cletrix / install_Haxe_Neko_hxcpp_lime _OpenFL.txt
Created Nov 13, 2015
Install Haxe, Neko, hxcpp, lime and OpenFL (3.2.2) on a raspberry pi 2 ( 06-08-2015 )
View install_Haxe_Neko_hxcpp_lime _OpenFL.txt
sudo apt-get install libgc-dev libpcre3-dev
sudo apt-get install mesa-utils build-essential git cmake libx11-dev
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libasound2-dev
#optional but recommended
sudo apt-get install sqlite3 libsqlite3-dev
sudo apt-get install libgtk2.0-dev (installs a lot of dependencies)
sudo apt-get install libmysqlclient-dev
#end optional
View tornado_socket_server.py
import errno
import functools
import socket
from tornado import ioloop, iostream
class Connection(object):
def __init__(self, connection):
self.stream = iostream.IOStream(connection)
self._read()
View tornado_socket_server.py
import errno
import functools
import socket
from tornado import ioloop, iostream
class Connection(object):
def __init__(self, connection):
self.stream = iostream.IOStream(connection)
self._read()
You can’t perform that action at this time.