add the taps, unlink the old PHP if required and add php7
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56
brew install php70
### Find Block Device | |
diskutil list | |
### Unmount USB Stick | |
diskutil unmountDisk /dev/diskX | |
### Write ISO to USB |
<? | |
include ("htmlparser.inc"); | |
$get_url = $_POST["url"]; | |
$parser = HtmlParser_ForFile($get_url); | |
$image_urls = array(); | |
while ($parser->parse()) { | |
if ($parser->iNodeType == NODE_TYPE_ELEMENT) { |
#!/bin/bash | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
# Code example for: | |
# Hello World - Machine Learning Recipes #1 - Google Developers | |
# https://www.youtube.com/watch?v=cKxRvEZd3Mw | |
from sklearn import tree | |
# Bumpy = 0, Smooth = 1 | |
features = [[140, 1], [130, 1], [150, 0], [170, 0]] | |
# Apple = 0, Orange = 1 | |
labels = [0, 0, 1, 1] |
If any exceptions are encountered due to 3rd party/local observers debugging can be questionable as no log | |
is created to determine root cause. This mini doc covers how to use the XML-RPC API in Magento to test a | |
product update API call that is returning a 500 internal server error due to an observer firing in 3rd party | |
code. Using some simple XML docs prepared for login and the request it is easier to see the Fatal error | |
returned for a request, in this example product.update. | |
xmlrpclogin.xml contents: | |
<?xml version="1.0"?> | |
<methodCall> |
<?php | |
class Namespace_Module_Model_Price_Import extends Mage_Core_Model_Abstract | |
{ | |
/** | |
* DB Connection | |
* | |
* @var Varien_Db_Adapter_Interface | |
*/ | |
protected $_conn; |
<?php | |
// $foo = Mage::getModel('..... | |
// $bar = Mage::getModel('..... | |
$transaction = Mage::getModel('core/resource_transaction'); | |
$transaction->addObject($foo); | |
$transaction->addObject($bar); | |
$transaction->save(); // runs save on all objects. On error -> rollback |
<?php | |
/* | |
* /app/design/frontend/default/your_theme/template/page/intercom-io.phtml | |
*/ | |
// Settings for the intercom.io app. | |
if( $this->helper('customer')->isLoggedIn() ): ?> | |
<?php $customer = Mage::helper('customer')->getCustomer()->getData(); ?> | |
<script id="IntercomSettingsScriptTag"> |
-- | |
-- Magento CE database clean-up extended | |
-- | |
-- This is an extended clean-up which will clean search, import/export, reports, etc. | |
-- | |
-- @author Constantin Bejenaru <boby@frozenminds.com> | |
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/) | |
-- @license http://www.opensource.org/licenses/mit-license.html MIT License | |
-- |