Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Brinkmann luckyduck

View GitHub Profile
@luckyduck
luckyduck / Navigation.php
Created Sep 23, 2012
Patch for "Webguys / Customer Navigation" (add "My Applications" for Magento 1.7)
View Navigation.php
<?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;
View iOS Singleton
//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 Dec 22, 2013
Typo3 Flow Settings.yaml example
View Settings.yaml
TYPO3:
Flow:
persistence:
backendOptions:
driver: 'pdo_mysql'
dbname: 'helloflow'
user: 'helloflow'
password: 'helloflow'
host: '127.0.0.1'
View luckyduck_angularlist.xml
<?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>
View list.phtml
<div ng-app>
<p>Nothing here {{'yet' + '!'}}</p>
</div>
View list.phtml
<div ng-app>
<ul>
<li>
<span>Produkt #1</span>
<p>
Traces of the most awesome test product ever created.
</p>
</li>
<li>
View list.phtml
<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>
View list.phtml
<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>
View config.xml
<layout>
<updates>
<luckyduck_angularlist>
<file>luckyduck_angularlist.xml</file>
</luckyduck_angularlist>
</updates>
</layout>
View luckyduck_angularlist.xml
<?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>
You can’t perform that action at this time.