Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
aaronksaunders / App.tsx
Created March 11, 2020 21:15
Typscript version of react-hook-form code with Ionic Framework
import React, { useState } from "react";
import {
IonApp,
IonPage,
IonHeader,
IonContent,
IonItem,
IonLabel,
IonInput,
IonRadioGroup,
@dustinleblanc
dustinleblanc / .lando.yml
Last active September 1, 2021 19:15
Pantheon Build Tools with Lando Behat Testing
name: some-site
recipe: pantheon
config:
framework: drupal8
env: dev
site: some-site
id: some-uuid-string-here
drush: 8.3
php: '7.3'
webroot: web
@ve3
ve3 / Encryption.js
Last active August 10, 2023 10:51
Encrypt and decrypt between programming languages (PHP & JavaScript). (Newer version here https://gist.github.com/ve3/b16b2dfdceb0e4e24ecd9b9078042197 )
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
@johannez
johannez / allow_email_login.php
Last active February 24, 2021 01:07
Drupal 8 - Allow login by email
<?php
/**
* Implements hook_form_alter().
*/
function MODULE_form_user_login_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
// Allow login with email.
array_unshift($form['#validate'], 'MODULE_user_login_form_validate');
// Change the field label.
$form['name']['#title'] = new \Drupal\Core\StringTranslation\TranslatableMarkup('Email or Username');
@hsandt
hsandt / buildandrun-ios.sh
Last active August 25, 2024 20:07
Build and run on a connected iOS device from command-line (even if Unity Editor does not support auto-run for current Xcode version)
# Platform: OS X
#
# Role: pull last repository changes, then build and run on a connected iOS device
#
# Usage: ./buildandrun-ios.sh [version] [--run-only]
#
# Parameters:
# version version number (e.g. "v0.2", "v4rc3", etc.) for your Unity build name
# --run-only set this if the Unity project was already build and you don't want to rebuild it
#