Skip to content

Instantly share code, notes, and snippets.

@durango
durango / Remove Submodule
Created December 18, 2015 16:43 — forked from kyleturner/Remove Submodule
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
@durango
durango / gulp.js
Created November 5, 2015 16:48 — forked from Fishrock123/gulp.js
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@durango
durango / README.md
Last active August 29, 2015 14:20 — forked from xarem/README.md
  • Step 1, create Service in Automator:

Step 1

  • Step 2, set Service for files:

Step 2

  • Step 3: insert bash script (see below)
  • Step 4, save:
var sinon = require('sinon');
it("Should be able to set the validation mode", function(done) {
var spy = sinon.spy(AuthorizeCIM.AuthorizeRequest, 'send');
var date = new Date();
var options = {
customerType: 'individual',
payment: new Authorize.Payment({
creditCard: new Authorize.CreditCard({
cardNumber: '4111111111111111',

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@durango
durango / OAuth.php
Last active August 29, 2015 14:17 — forked from SchumacherFM/OAuth.php
<?php
class Zookal_Customer_Model_Observer_Controller_OAuth
{
/**
* @param string $url
*
* @return bool
*/
@durango
durango / _.md
Last active August 29, 2015 14:17 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke.
<?php
class Namespace_modulename_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction() {
//Basic parameters that need to be provided for oAuth authentication
//on Magento
$params = array(
'siteUrl' => 'http://localhost/magento/oauth',
'requestTokenUrl' => 'http://localhost/magento/oauth/initiate',
'accessTokenUrl' => 'http://localhost/magento/oauth/token',
'authorizeUrl' => 'http://localhost/magento/admin/oAuth_authorize',//This URL is used only if we authenticate as Admin user type

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
@durango
durango / README.md
Last active August 29, 2015 14:15 — forked from jonathantneal/README.md

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"