Skip to content

Instantly share code, notes, and snippets.

View djfordz's full-sized avatar

David Ford djfordz

View GitHub Profile
### Keybase proof
I hereby claim:
* I am djfordz on github.
* I am djfordz (https://keybase.io/djfordz) on keybase.
* I have a public key ASBc9FMLnzHur9LBY8cAz-hidsDY7pxOM13EbHzkEJDUIwo
To claim this, I am signing this object:
@djfordz
djfordz / addProductAttribute.php
Created July 11, 2019 23:39 — forked from 0-Sony/ addProductAttribute.php
Add Custom Attribute for products in custom Attributes set
<!-- local/Namespace/Catalog/data/Namespace_catalog_setup/data-install-0.0.1.php -->
<?php
try {
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
/**
* Custom attribute creation
@djfordz
djfordz / magento-nginx.conf
Created May 20, 2019 12:35 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
@djfordz
djfordz / SimpleHttpClient.cs
Created March 14, 2019 15:24 — forked from bryanbarnard/SimpleHttpClient.cs
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
// Add this to my.cnf to work with Laravel
[mysqld]
character-set-server=utf8mb4
character_set_client=utf8mb4
collation-server=utf8mb4_unicode_ci
innodb_default_row_format=dynamic
innodb_file_format=barracuda
innodb_file_per_table=true
innodb_large_prefix=true
@djfordz
djfordz / WSSoapClient.php
Created November 8, 2018 10:19 — forked from johnkary/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* Copyright (c) 2007, Roger Veciana
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
@djfordz
djfordz / gist:32477e84b02f55a0f1acb44388f7ee6d
Created August 10, 2018 16:24 — forked from tleen/gist:6382987
Test credit card numbers (via authorize.net)
American Express Test Card 370000000000002
Discover Test Card 6011000000000012
Visa Test Card 4007000000027
Second Visa Test Card 4012888818888
JCB 3088000000000017
Diners Club/ Carte Blanche 38000000000006
@djfordz
djfordz / server.badbots
Created July 26, 2018 11:06 — forked from hans2103/server.badbots
NGINX to block bad bots. (add Twenga|TwengaBot if you want to exclude them too)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz
@djfordz
djfordz / options-to-products.php
Created July 6, 2018 00:04 — forked from molotovbliss/options-to-products.php
Options (colors) to Products
<?php
require_once('app/Mage.php');
ob_implicit_flush(true);
umask(0);
set_time_limit(0);
ini_set('display_errors', 1);
Mage::app();
Mage::setIsDeveloperMode(true);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
@djfordz
djfordz / Varien-Debug-backtrace.php
Created July 5, 2018 23:32 — forked from molotovbliss/Varien-Debug-backtrace.php
Magento Varien_Debug::backtrace() (no truncating output)
EXAMPLE:
echo Varien_Debug::backtrace(true, true); exit;
DECLERATION:
static method backtrace
Prints or return a backtrace
access: public
static string|bool backtrace ([bool $return = false], [bool $html = true], [bool $withArgs = true])
bool $return: return or print