Skip to content

Instantly share code, notes, and snippets.

View alankent's full-sized avatar

Alan Kent alankent

View GitHub Profile
// Usage:
// grunt deploy - invokes magento dev:source-theme:deploy for all themes.
// grunt less - runs less over all themes
// grunt watch - watches for file changes.
// *** INTENDED TO BE ADJUSTED ***
// All theme handled.
var themes = ['Magento/luma', 'Magento/blank'];
@alankent
alankent / Gulpfile-config.js
Created February 1, 2016 01:12
Another experiment with Gulp.js, but this one leaves control to the developer. I don't have exec() right yet (not synchronous!) Seems to be in a more recent NodeJS that I am running.
// Usage:
// grunt deploy - invokes magento dev:source-theme:deploy for all themes.
// grunt less - runs less over all themes.
// grunt watch - watches for file changes with livereload.
// =========================== Configuration ===========================
// The default Less processing pipeline.
function lessPipeline(srcLessFile, destDir) {
@alankent
alankent / validate_m2_package.php
Last active February 15, 2016 10:39
Magento Marketplace beta Composer package ZIP file validator script.
#!/usr/bin/php
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See https://github.com/magento/magento2/blob/develop/COPYING.txt for license details.
*/
/**
* validate_m2_package.php - a script that checks a given M2 zip package to ensure
* it is structured correctly and has all the required files.
#!/usr/bin/php
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See https://github.com/magento/magento2/blob/develop/COPYING.txt for license details.
*/
/**
* validate_m2_package.php - a script that checks a given M2 zip package to ensure
* it is structured correctly and has all the required files.
@alankent
alankent / pkglist.php
Created May 13, 2016 04:59
Connect to Magento 2 Composer repo and list packages you can access
<?php
/**
* Return the path of the auth.json file.
*/
function findAuthJson() {
// Windows sets HOMEDRIVE and HOMEPATH, but cygwin sets HOME.
if (!isset($_SERVER["HOME"]) && isset($_SERVER["HOMEDRIVE"])) {
@alankent
alankent / as.html
Created August 21, 2019 22:48
Testing AMP amp-script and float (when served locally, bug causes script not to load external file)
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<title>AMP Script Example</title>
<link rel="canonical" href="https://www.example.com/url/to/myself/if/amp-first">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
using UnityEngine;
using UnityEditor;
using UnityEngine.Timeline;
using UnityEngine.Playables;
using System.Collections.Generic;
public class MyAssemblyWindow : EditorWindow
{
[MenuItem("Window/Alan Tools/Assembly")]
public static void ShowWindow()
using UnityEngine;
[ExecuteAlways]
public class TrackObjects : MonoBehaviour
{
public Transform target1;
[Range(0f, 1f)] public float target1Weight;
public Transform target2;
[Range(0f, 1f)] public float target2Weight;
using System.Collections;
using System.Collections.Generic;
using UniGLTF;
using UnityEngine;
using VRM;
// This component goes on VRoid character root for animating where the eyes look at.
// The eyes can look between different targets or at specified left/right/up/down position.
// The idea is this scripts controls the position of a separate target object that must be created in the scene that the VRM look at scripts then specify as their look at target.
// That is, this does not modify what the eyes look at directly, but rather moves a target object that that eyes must look at.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AlansBlendShapeClipVowels : MonoBehaviour
{
[Range(0f, 1f)] public float A;
[Range(0f, 1f)] public float E;
[Range(0f, 1f)] public float I;
[Range(0f, 1f)] public float O;