This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-18.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let assetsDir = "assets"; | |
module.exports = { | |
assetsDir: assetsDir, | |
configureWebpack: { | |
output: { | |
filename: assetsDir + "/[name].js", | |
chunkFilename: assetsDir + "/[name].js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script was created to convert a directory full of Mailchimp Campaigns html files into md equivalents. | |
# It uses to-markdown-cli to do the conversion. | |
# | |
# 1. Install https://www.npmjs.com/package/to-markdown-cli (you must be installed node) | |
# 2. Copy this script into the directory containing the .html files | |
# 3. Modify 'sed' init and 'sed' final conditions | |
# - '1,/<center>/d' -> Remove all html content from init to first <center> | |
# - '/Ver este mensaje en el navegador/,/<\/html>/d' -> Remove all html content from "Ver este mensaje en el navegador" text to finish | |
# 4. Ensure that the script has execute permissions | |
# 5. Run the script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(). | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = [...document.getElementsByTagName('h3')].map( i => i.innerHTML ) | |
console.table(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
contract SampleContract { | |
uint storageData; | |
function set(uint x) public { | |
storageData = x; | |
} | |
function get() public view returns (uint) { | |
return storageData; | |
} |