Skip to content

Instantly share code, notes, and snippets.

View jackbravo's full-sized avatar

Joaquin Bravo Contreras jackbravo

View GitHub Profile
@jackbravo
jackbravo / Mapa.md
Created August 10, 2024 23:04
Mapa Conceptual
@startuml
!define RECTANGLE class

RECTANGLE "Cadena de Valor" as CV {
    Representación de las actividades productivas de una
    empresa o sector que agregan valor al producto o servicio final
}

RECTANGLE "Responsabilidad Social Empresarial (RSE)" as RSE {
@jackbravo
jackbravo / Light darkish.itermcolors
Created May 20, 2020 23:39
My modification of Light Dark iterm colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@jackbravo
jackbravo / MediaLibraryController.php
Created November 28, 2018 22:19
Example to launch media library with a custom input
<?php
namespace Drupal\layout_manager\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Url;
/**
* Controller to render basic html for client side application.
@jackbravo
jackbravo / code_sample.php
Created February 22, 2018 00:54
Tell me what you see
<?php
class Document {
public $user;
public $name;
public function init($name, User $user) {
assert(strlen($name) > 5);
$this->user = $user;
$this->name = $name;
}
public function getTitle() {
@jackbravo
jackbravo / anagram.php
Created February 22, 2018 00:53
PHP Anagram exercise
<?php
/***
# Anagram clasification
## Concepts
Anagrams are words with exactly the same letters in different order
e.g., AMOR, ROMA, and MORA
## What we need
<?php
namespace Drupal\guia_commerce\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class ExchangeRateForm.
*/
### Keybase proof
I hereby claim:
* I am jackbravo on github.
* I am jackbravo (https://keybase.io/jackbravo) on keybase.
* I have a public key ASCL22NAcm3VaLEnMmaKfUVUw9BkA8wUkeVnsQ1ilgwJ5Qo
To claim this, I am signing this object:
<?php
namespace Drupal\custom_theme_helpers;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
/**
* Class CustomThemeNegotiator.
*
* @package Drupal\bixal_theme_helpers
$type_manager = \Drupal::entityTypeManager()->getStorage('commerce_payment');
$payments = $type_manager->loadByProperties(['remote_id' => 'LTCL000016']);
$payment = reset($payments);
$payment->state = 'pending';
$payment->save();
@jackbravo
jackbravo / psql_dev_start.sh
Last active August 10, 2017 19:46
postgres dev start
createuser -Psd guia
createdb -O guia guia
# psql
# alter user guia with encrypted password 'guia'; -- not needed if using -P (prompt password)
# grant all privileges on database guia to guia ; -- not needed if using createdb -O (give ownership)
# alter user guia createdb ; -- not needed if using -d in createuser