Skip to content

Instantly share code, notes, and snippets.

@olivermontes
olivermontes / index.pug
Created August 25, 2021 23:08
Random ember canvas 🔥😎
canvas
.menu
button
.icon
span
span
span
label
| Amount
input(type='range', min="1", max="500", step="1", value="100", id="AMOUNT")
@olivermontes
olivermontes / writeisomac.sh
Created October 7, 2020 07:04 — forked from oliver-montes/writeisomac.sh
Grabar imagen ISO en USB desde Mac OS
### Find Block Device
diskutil list
### Unmount USB Stick
diskutil unmountDisk /dev/diskX
### Write ISO to USB
@olivermontes
olivermontes / README.md
Created July 26, 2017 19:36
Install PHP7 on OS X El Capitan

Install PHP7 on OS X El Capitan

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
@olivermontes
olivermontes / gist:bf333d468888c95c28ccfbe35abf2ee1
Created June 17, 2016 14:46
PHP Script to grab all images from a remote site.
<?
include ("htmlparser.inc");
$get_url = $_POST["url"];
$parser = HtmlParser_ForFile($get_url);
$image_urls = array();
while ($parser->parse()) {
if ($parser->iNodeType == NODE_TYPE_ELEMENT) {
@olivermontes
olivermontes / restart_bluetooth.sh
Created April 19, 2016 07:53 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@olivermontes
olivermontes / hello-world.py
Created April 17, 2016 00:54 — forked from alejandrofloresm/hello-world.py
Hello World for Google
# 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]
@olivermontes
olivermontes / gist:12a31c20c7fbd94ca988
Created October 22, 2015 16:42 — forked from molotovbliss/gist:3c7352f774873fb737c3
Using cURL via CLI to debug Magento's XML-RPC API calls
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>
@olivermontes
olivermontes / create_group_prices_magento.php
Last active August 29, 2015 14:27 — forked from herveguetin/create_group_prices_magento.php
Create/update group prices programmatically in Magento
<?php
class Namespace_Module_Model_Price_Import extends Mage_Core_Model_Abstract
{
/**
* DB Connection
*
* @var Varien_Db_Adapter_Interface
*/
protected $_conn;
@olivermontes
olivermontes / gist:0f2b1fdcb2a3f6ad5810
Last active August 29, 2015 14:27 — forked from cmuench/gist:3082029
Magento: Save multiple models in one transaction
<?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">