Skip to content

Instantly share code, notes, and snippets.

View luckyduck's full-sized avatar

Jan Brinkmann luckyduck

View GitHub Profile
@luckyduck
luckyduck / Navigation.php
Created September 23, 2012 15:17
Patch for "Webguys / Customer Navigation" (add "My Applications" for Magento 1.7)
<?php
class Webguys_CustomerNavigation_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {
public function getLinks(){
$pre_links = $this->_links;
$tmp_links = array();
$this->_links = array();
$startcnt = 100000;
//Singleton.h
+ (id) sharedInstance;
// singleton.m
+ (id)sharedInstance {
static BackendResource *shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[self alloc] init];
});
@luckyduck
luckyduck / Settings.yaml
Created December 22, 2013 11:09
Typo3 Flow Settings.yaml example
TYPO3:
Flow:
persistence:
backendOptions:
driver: 'pdo_mysql'
dbname: 'helloflow'
user: 'helloflow'
password: 'helloflow'
host: '127.0.0.1'
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addJs">
<script>luckyduck_angularlist/angular.min.js</script>
</action>
</reference>
</default>
</layout>
<div ng-app>
<p>Nothing here {{'yet' + '!'}}</p>
</div>
<div ng-app>
<ul>
<li>
<span>Produkt #1</span>
<p>
Traces of the most awesome test product ever created.
</p>
</li>
<li>
<div ng-app="angularlistApp">
<div ng-controller="ProductListCtrl">
<ul>
<li ng-repeat="product in products">
{{product.name}}
<p>{{product.description}}</p>
</li>
</ul>
<p>Total number of products: {{products.length}}</p>
<script type="text/javascript">
var angularlistApp = angular.module('angularlistApp', []);
angularlistApp.controller('ProductListCtrl', function($scope, $http) {
$http.get('<?php echo Mage::getBaseUrl()?>api/rest/products').success(function(data) {
$scope.products = data;
});
});
</script>
<layout>
<updates>
<luckyduck_angularlist>
<file>luckyduck_angularlist.xml</file>
</luckyduck_angularlist>
</updates>
</layout>
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addJs">
<script>angularlist/angular.min.js</script>
</action>
</reference>
</default>