Skip to content

Instantly share code, notes, and snippets.

View iods's full-sized avatar

Rye Miller iods

View GitHub Profile
@iods
iods / .editorconfig
Last active July 1, 2023 22:41
My top level .editorconfig for multiple projects.
# This file creates a uniform coding style for different languages and IDEs
# Copyright © 2017 - Present, Rye Miller || The Dark Society
# Version 0.1 - https://gist.github.com/iods/75078fe2cd942b54f7d4257d3170c46e
# 07/01/2023
# @see https://editorconfig.org/
root = true
[*]
charset = utf-8
<?php
header("Content-type: application/json; charset=utf-8");
header("Access-Control-Allow-Origin: *")
$magentoSiteUrl = 'http://www.YOUR-SITE.com';
$userData = array("username" => 'A_ADMIN_USERNAME', "password" => 'A_ADMIN_PASSWORD');
define('MAGENTO_SITE_URL',$magentoSiteUrl);
$ch = curl_init($magentoSiteUrl."/index.php/rest/V1/integration/admin/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@iods
iods / magento2-catalog-guide.php
Last active November 18, 2022 06:39
[Magento 2] Catalog Helpers
<?php
function isPalindrome($text) {
$text = preg_replace('/[^a-zA-Z]/', '', $text);
$text = strtolower($text);
if (strrev($text) == $text) {
return true;
} else {
return false;
@iods
iods / php-arrays.php
Last active December 1, 2022 20:52
[PHP] 7* Helpers
<?php
function reverseArray($arr1) {
$size = count($arr1);
for($i = $size -1; $i >= 0; $i--) {
$arr1[$size] = $arr1[$i];
unset($arr1[$i]);
$size++
}
@iods
iods / magento2-lessons.md
Last active November 18, 2022 03:28
[Magento 2] Lessons

Drupal 8.x lessons

Edit

A basic structure for teaching Drupal 8.x with lesson bundles. Bundles can/should be taught independently.

Table of Contents

@iods
iods / magento2-cli-guide.md
Last active November 18, 2022 05:34
[Magento 2] CLI Helpers

https://www.drupal.org/node/2209627/revisions/view/9770853/10538567

This document is a reference for evaluating the completeness of examples modules. It is marked as belonging to the 8.x-1.x branch, but it applies to all examples.

It's meant to evolve, so please comment and update if necessary.

Examples Module Checklist QA

Functional tests of all paths defined by the module.

@iods
iods / Asset.md
Created March 18, 2017 03:17
PHP Control Structures

Control Structures in PHP

In programming, a problem specific to decision making and the flow of execution can be broken down into three specific types of control structures. These are:

  • Sequential Execution
  • Loops (while, do/while, for, etc.)
  • Two-Way Decisions (if, if/else, switch, etc.)

Examples

These report filters are setup to generate a high-level overview of projects and issues for a better understanding of status and resources.

To find all issues without a Due Date, sorted by Created Date, Sorted by Priority

duedate = EMPTY order by created, priority asc

Find all issues which are not assigned.

assignee = null
@iods
iods / DockBlock.php
Created July 27, 2016 07:06
Standards of PHP Development
<?php
/* Source File Headers
*--------------------------------------------------*/
/**
* A Darkstar Project : Namespace with API or Component
*
* PHP version 5.x
*
* @api
* @license OSL-3.0
@iods
iods / File-1.php
Created July 27, 2016 07:04
Magento 1.x DocBlock
<?php
/**
* Darkstar Development
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to update or upgrade the modules
* or applications developed by Rye Miller. If you wish to customize this for
* your own purpose, please contact the developer.
*