Skip to content

Instantly share code, notes, and snippets.

View kennyhorna's full-sized avatar
🏠
Working from home

Kenny Horna kennyhorna

🏠
Working from home
View GitHub Profile
{
"data": [
{
"restaurant_id": 1,
"name": "Huel, Kessler and Gulgowski",
"ruc": "26934766963",
"picture": "/home/ke3nnix/Proyectos/pidelo/public/restaurants/default.img",
"address": "539 Alice Land Suite 724",
"latitude": "-12.0369340",
"longitude": "-77.0386990",
@kennyhorna
kennyhorna / event-payload.json
Created May 5, 2018 18:22
Pusher event response
{
"reservation_id": 9,
"user_full_name": "Reserva manual",
"venue_id": 1,
"venue_name": "La 35",
"venue_address": "4103 Elmer Coves Apt. 702",
"date": "06/05/2018",
"status": "pending",
"is_manual": 1,
"total": "90.00",
{
"11/05/2018": [
{
"detail_id": 75,
"reservation_id": 40,
"field_id": 1,
"field_name": "Cancha 5",
"field_size": "Fútbol 10",
"field_type": "Losa deportiva",
"hour": "19:00:00",
{
"data": {
"venue_id": 1,
"business_id": 1,
"name": "Soccer Palace 25",
"address": "496 Vandervort Port Apt. 787",
"latitude": "-12.0375380",
"longitude": "-77.0197650",
"fields": [
{
let index = client.index(withName: "venues")
let query = Query(query: "La Bombonera") // acá seteas el término de búsqueda
query.aroundLatLng = LatLng(lat: 40.71, lng: -74.01) // acá seteas la ubicación
query.hitsPerPage = 10 // con esto se limita el tamaño de la respuesta
query.getRankingInfo = true // esto traerá información adicional como la distancia del local a la ubicación indicada
index.search(query, completionHandler: { (content, error) -> Void in
if error == nil {
print("Result: \(content!)") // aquí ya pintas la vista con la data recibida
}
})
// Acá está la documentación: https://pusher.com/docs/ios_quick_start
/*
* CONEXIÓN
*/
let options = PusherClientOptions(
host: .cluster("YOUR_CLUSTER") // credenciales
)
let pusher = Pusher(key: "YOUR_APP_KEY", options: options) // credenciales
server_name XXX.XXX.XXX.XXX www.mydomain.app mydomain.app prod.mydomain.app;
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
@kennyhorna
kennyhorna / generar-token-culqi.java
Created May 28, 2018 20:00
Método en Android para generar token de tarjeta CULQI
Card card = new Card(“411111111111111”, “123”, 9, 2020, “[email protected]”); // LOS DATOS DE LA TARJETA, SE TIENE QUE PONER EL EMAIL
Token token = new Token("{CODIGO COMERCIO}"); // ACÁ VA LA LLAVE PÚBLICA DE CULQI,
token.createToken(getApplicationContext(), card, new TokenCallback() {
@Override
public void onSuccess(JSONObject token) {
// get Token
token.get("id").toString() // ESTE TOKEN ES EL QUE TIENES QUE ENVIAR AL API (COMO "token_id")
}
{
"reservation_id": 634,
"user_id": 1,
"user_full_name": "Kenny Chingon Horna",
"user_image": "images/users/avatars/1.jpeg",
"venue_id": 63,
"venue_name": "Canchita 01",
"venue_address": "82634 Mazie Green",
"date": "08/06/2018",
"status": "cancelled",
{
"reservation_id": 635,
"user_full_name": "Reserva manual",
"user_image": "images/users/avatars/default.jpg",
"venue_id": 35,
"venue_name": "Arena Fútbol 82",
"venue_address": "5505 Isabella Mountain Suite 506",
"date": "06/06/2018",
"status": "pending",
"is_manual": true,