Skip to content

Instantly share code, notes, and snippets.

View RidRack's full-sized avatar
💯

Aaron Rickard RidRack

💯
View GitHub Profile
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 21, 2024 08:34
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active July 19, 2024 01:24
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@antoinekociuba
antoinekociuba / shopping_cart_sales_rule_with_coupon.php
Last active September 16, 2023 11:00
Magento - Create shopping cart price rule with a specific coupon code programmatically.
<?php
/**
* Create Shopping Cart Sales Rule with Specific Coupon Code Programmatically
*/
// All customer group ids
$customerGroupIds = Mage::getModel('customer/group')->getCollection()->getAllIds();
// SalesRule Rule model
$rule = Mage::getModel('salesrule/rule');
@antoinekociuba
antoinekociuba / product_attribute_installer.php
Created August 3, 2014 22:48
Magento Product Attribute installer script.
<?php
/**
* Product Attribute Installer
*/
try {
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active July 19, 2024 14:51
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@mpaepper
mpaepper / gist:6168c9617630f96a8bfc
Created June 8, 2015 03:31
What you need to know about debugging Magento cart price rules
Sometimes you have the problem that a Magento cart price rule does not work when you enter a coupon code, although you think it should.
There are certain areas where it could fail and I will illustrate the two most important ones.
First check for the file Mage_SalesRule_Model_Validator and its protected function _canProcessRule($rule, $address).
The rule fails inside that function and this can be for many reasons which I would divide into two main categories:
a) General limitations such as a usage limit (code can only be used 5 times), customer limit (can only be used once per customer)
b) If the general limitations do not apply, the rule will fail at if (!$rule->validate($address)) so at its validate() method.
To debug this, I found that it is most useful to go to the file Mage_Rule_Model_Condition_Combine and in the function validate() enter the following code:
@markshust
markshust / data-install-0.0.0.1.php
Created July 9, 2015 12:39
update magento static block programmatically through upgrade scripts
<?php
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$connection = $installer->getConnection();
$identifier = 'id-goes-here';
$title = 'Title Goes Here';
@schmich
schmich / ducky.md
Last active July 10, 2024 10:25
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@HeratPatel
HeratPatel / git-flow.md
Last active July 19, 2024 08:31
Git Flow: Git branches workflow for larger and continues releasing projects. #git #gitflow

Git Flow: A Successful Git branching model

Alt Text

Gitflow is a Git workflow design that was first published and made popular by Vincent Driessen at nvie. The Gitflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.

Gitflow is ideally suited for projects that have a scheduled release cycle. This workflow doesn’t add any new concepts or commands beyond what’s required for the Feature Branch Workflow. Instead, it assigns very specific roles to different branches and defines how and when they should interact. In addition to feature branches, it uses individual branches for preparing, maintaining, and recording releases. Of course, you also get to leverage all the benefits of the Feature Branch Workflow: pu