Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@delineas
delineas / gh-pages.yml
Created Apr 29, 2020 — forked from syuji-higa/gh-pages.yml
GitHub Actions - Genelate Nuxt.js deploy for GitHub Pages
View gh-pages.yml
name: github pages
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
@delineas
delineas / some_test.js
Created Jan 4, 2020 — forked from mbrochh/some_test.js
Controlling a Stripe payent popup with Cypress.io
View some_test.js
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json
describe('Make Stripe Payment', function() {
before(function() {
cy.visit('http://localhost:3000/en/stripe/checkout/')
Cypress.Cookies.preserveOnce('sessionid')
})
it('should enter credit card details and finalise payment', function() {
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click()
@delineas
delineas / array_flatten.php
Created Jul 10, 2019 — forked from SeanCannon/array_flatten.php
PHP array_flatten() function. Convert a multi-dimensional array into a single-dimensional array.
View array_flatten.php
<?php
/**
* Convert a multi-dimensional array into a single-dimensional array.
* @author Sean Cannon, LitmusBox.com | seanc@litmusbox.com
* @param array $array The multi-dimensional array.
* @return array
*/
function array_flatten($array) {
if (!is_array($array)) {
@delineas
delineas / gist:1e55c9cb911e631174a93726b553d45e
Created May 23, 2019 — forked from johnennewdeeson/gist:22196a15b3ea115a2451
Make alt text required when uploading images using media widget (Drupal)
View gist:1e55c9cb911e631174a93726b553d45e
/**
* Implements hook_form_FORM_ID_alter().
*/
function mymodule_form_file_entity_add_upload_alter(&$form) {
_mymodule_media_form_alter($form);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
@delineas
delineas / Flask_JWT_Auth
Created Mar 5, 2019 — forked from prameshbajra/Flask_JWT_Auth
Flask API JWT Authentication without database.
View Flask_JWT_Auth
from flask import Flask
from flask_jwt import JWT, jwt_required, current_identity
from werkzeug.security import safe_str_cmp
class User(object):
def __init__(self, id, username, password):
self.id = id
self.username = username
self.password = password
View branch-organization.md

Scenario

Work is done within a feature branch created from master. You've incrementally gotten the feature branch working as expected; however, you'd prefer to re-organize your commits so that you can better reason about the changes.

Setup

Let's create a new repository in order to set the stage:

 % mkdir repo
 % cd repo
 % git init
@delineas
delineas / drupal8-links.php
Created Jul 24, 2018 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function
View drupal8-links.php
@delineas
delineas / TermBreadcrumbBuilder.php
Created Jul 16, 2018 — forked from eeeschwartz/TermBreadcrumbBuilder.php
Load breadcrumbs from a Drupal 8 node's taxonomy term
View TermBreadcrumbBuilder.php
<?php
/**
* @file
* Contains \Drupal\taxonomy\TermBreadcrumbBuilder.
*/
namespace Drupal\taxonomy;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
View Drupal 8 loop entity reference fields.twig
Twig coding standards
https://www.drupal.org/node/1823416
Filters - Modifying Variables In Twig Templates
https://www.drupal.org/node/2357633
{% for i, value in content.field_app_prod_toggle_products %}
{% if node.field_app_prod_toggle_products[i].entity %}
{% if i == 0 %}
@delineas
delineas / mailchimp-subscribe.js
Last active Apr 30, 2018 — forked from chrsgrffth/mailchimp-subscribe.coffee
Vue – Mailchimp Subscribe Component
View mailchimp-subscribe.js
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
// To get the `action` prop:
//
// 1. Go to your dashboard on mailchimp.com and navigate
// to Lists > Signup Forms > Embedded Forms.
//
You can’t perform that action at this time.