Skip to content

Instantly share code, notes, and snippets.

View zazk's full-sized avatar
:octocat:
Let's talk about Javascript & DevOps

Enrique Juan de Dios zazk

:octocat:
Let's talk about Javascript & DevOps
View GitHub Profile
{
"payments": [
{
"type": 1,
"name": "credit",
"enable_chip": "0",
"subpayments": [],
"account_type": null,
"order_type": null
},
@zazk
zazk / sent.ts
Last active September 29, 2017 17:45
How to get angry with php post variables..
// Why PHP needs the x-www-form-urlencoded!!
this.http
.post('http://w.areminds.com/api/index.php', params, {
headers: new HttpHeaders().set(
'Content-Type',
'application/x-www-form-urlencoded'
)
})
@zazk
zazk / AppDelegate.swift
Created September 15, 2017 01:25 — forked from roytornado/AppDelegate.swift
iOS Remote Notification
import UIKit
import Firebase
import UserNotifications
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
static var shared: AppDelegate { return UIApplication.shared.delegate as! AppDelegate }
@zazk
zazk / Global.sublime-settings
Created September 11, 2017 15:47 — forked from benatkin/Global.sublime-settings
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@zazk
zazk / why.markdown
Created July 28, 2017 10:35 — forked from egonSchiele/why.markdown
Why read Grokking Algorithms?

If you have already taken a course in algorithms, why read Grokking Algorithms (manning.com/bhargava)?

If you were learning graph algorithms, which approach would you prefer:

  1. Imagine you have to take public transit from your home to your office. How do you figure out the fastest route? Use graph algorithms! OR

  2. We can choose between two standard ways to represent a graph G = (V, E): as a collection of adjacency lists or as an adjacency matrix. Either way applies to both directed and undirected graphs.

I prefer the first way: lead with lots of examples, and clear writing. The second way is an excerpt from "Introduction to Algorithms"...that's how they start their section on graph algorithms.

@zazk
zazk / upload.cs
Created November 8, 2016 19:36
Upload File Example C#
[HttpPost]
public ActionResult EditPerfil(HttpPostedFileBase file, string nombre, int UserID = 0, string contacto="",
string email = "", string fnac="")
{
string oripath = "";
string path = "";
string pathcomment = "";
string pathgrupo = "";
string strExt = "";
string name = "";
/*
A little late for a suggestion but I found one way of doing this
(maybe not the best don't hesitate to comment in order to improve).
The idea is to save each drawn path in a list and when "undo" is pressed,
all the previous paths are drawn except the last one.
Warning: I don't use the erase function (the white color is enough for me).
This answer needs to be adapted (by also remembering the removed paths) in order to work with this functionality.
To do so you need to:
1 - create two new buttons in the drawing activity;

Instalación del proyecto en Digital Ocean

1. Crear dropplet

Entrar a www.digitalocean.com, loguearse y crear el droplet. Escoger Ubuntu 14.04.

2. Creamos un usuario y le damos todos los permisos

$ sudo adduser devjd
$ visudo

devjd ALL=(ALL:ALL) ALL
@zazk
zazk / face.detected.js
Created July 26, 2016 01:07
Face Detected
{
"pk": 2,
"url": "http://localhost:8000/faceimages/2/",
"title": "Julio",
"original_image": "http://localhost:8000/media/uploads/originals/13775476_1216361785075571_1740938480826067569_n.jpg",
"processed_image": "http://localhost:8000/media/uploads/processed/13775476_1216361785075571_1740938480826067569_n.jpg-processed.png",
"created_date": "2016-07-26T01:05:01.627999Z",
"modified_date": "2016-07-26T01:05:02.843087Z",
"face_coordinates": [
@zazk
zazk / connection.json.php
Created July 25, 2016 15:51
MySQL Connection PHP mysqli
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$servername = "IP_SERVER";
$username = "IP_USERNAME";
$password = "IP_PASSWORD";
$dbname = "IP_DATABASE";
$query = "IP_SQL_QUERY";