View gh-pages.yml
name: github pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-18.04 |
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() |
View vue.config.js
let assetsDir = "assets"; | |
module.exports = { | |
assetsDir: assetsDir, | |
configureWebpack: { | |
output: { | |
filename: assetsDir + "/[name].js", | |
chunkFilename: assetsDir + "/[name].js" | |
} |
View convert_html_md.sh
# 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 |
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)) { |
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(). | |
*/ |
View geocoding.js
// From https://developer.here.com/api-explorer/rest/geocoder/reverse-geocode | |
$.ajax({ | |
url: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json', | |
type: 'GET', | |
dataType: 'jsonp', | |
jsonp: 'jsoncallback', | |
data: { | |
prox: '39.2134,10.0956,250721', | |
mode: 'retrieveAddresses', |
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 console.js
var text = [...document.getElementsByTagName('h3')].map( i => i.innerHTML ) | |
console.table(text) |
NewerOlder