Skip to content

Instantly share code, notes, and snippets.

View vnponce's full-sized avatar

Abel Ponce vnponce

View GitHub Profile
What do you like/dislike about this pice of code?
<?php
class CompanyFinder {
public const ENDPOINT = 'https://some.api';
public function getCompanyName(string $identification): ?string
{
@vnponce
vnponce / eb.rb
Last active December 28, 2023 07:44
Consuming EB API
require 'uri'
require 'net/http'
require 'json'
require 'test/unit'
MAX_LIMIT_ITEMS = 50
FIRST_PAGE_URL = "https://api.stagingeb.com/v1/properties?page=1&limit=#{MAX_LIMIT_ITEMS}"
API_KEY = 'l7u502p8v46ba3ppgvj5y2aad50lb9'
@vnponce
vnponce / tdd-submitForm-checkbox.txt
Created March 31, 2017 06:10
Laravel has problems with tdd and multiple selector checkbox... so this is one option with ->submitForm() . The problem is if I need to upload an image, ->submitForm( ) not has that function, I guess.
Laravel integration tests and multiple check boxes
Some tips for checking and unchecking a list of multiple check boxes in a form during your Laravel 5.1 integration testing.
<input name="multi_cb[]" type="checkbox" value="1">
<input name="multi_cb[]" type="checkbox" value="2">
<input name="multi_cb[]" type="checkbox" value="3">
If you have multiple check boxes in your HTML using an array-style name, you can interact with them in 2 different ways.
If you only have to check certain checkboxes, you can submit the form with an array of the post values.
@vnponce
vnponce / form-module.ts
Created January 5, 2017 16:37
Angular 2 from hero to practice - Form modules driven
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {
Component,
NgModule,
Input,
Output,
EventEmitter
} from '@angular/core';
import {
@vnponce
vnponce / custom-directives.ts
Last active January 5, 2017 16:36
This gist is an exercise for custom directives from Angular 2 from hero to practice // Angular 2 from hero to practice - Custom Directive
// Practice Activity (Custom Directives)
// Sección 6, Clase 60
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {
Component,
Directive,
HostListener,
HostBinding,
NgModule,
@vnponce
vnponce / gist:68b4c243f23bad6fae2738859697c139
Created December 18, 2016 05:43 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Instlar composer por comandos con Linux y Mac
curl -sS https://getcomposer.org/installer | php
Mover a global
sudo mv ~/composer.phar /usr/local/bin/composer
Crear proyecto con composer
composer create-project laravel/laravel blog
@vnponce
vnponce / gist:b1a4e2d683e531e0cfc8
Created October 8, 2015 23:50
Snippet to create a custom circle inner a bootstrap div
<style>
/*Circle Style*/
.circle {
width: 100%;
padding: 10%;
background: white;
border-radius: 50px;
}
.circle p {
@vnponce
vnponce / node.sh
Created September 24, 2015 03:24
Node JS Install Ubuntu / Debian
#!/bin/bash
# Install Node Repository
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
# Update dependencies
sudo apt-get update
# Install Node.js
sudo apt-get install nodejs
@vnponce
vnponce / leccion 8
Last active August 29, 2015 14:15
Curso básico L5 - Fluent y Eloquent en Laravel 5 – Parte 1
- Crea un query para imprimir todos los usuarios de tipo “user”.
$result = \DB::table('users')
->where('type', 'user')
->get();
- Crea un query para imprimir sólo el nombre y el email del usuario ordenados alfabéticamente.
$result = \DB::table('users')
->select('first_name', 'email')
->orderBy('first_name', 'ASC')