Skip to content

Instantly share code, notes, and snippets.

View viezel's full-sized avatar

Mads Møller Schrøder viezel

View GitHub Profile
@viezel
viezel / local.xml
Last active December 20, 2015 08:19
Magento - How to move Toolbar to the left/right column
<catalog_category_layered translate="label">
<reference name="left">
<!-- Adds the toolbar to the left column -->
<block type="catalog/category_view" name="category.page.toolbar" template="catalog/category/sidetoolbar.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml" />
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</block>
/*! Socket.IO.js build:0.9.6, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
/**
* Originally Ported to titanium by Jordi Domenech <jordi@iamyellow.net>
* source: https://github.com/iamyellow/socket.io-client
*/
this.io = {};
module.exports = this.io;
/**
@viezel
viezel / api.js
Last active August 29, 2015 13:57
Angular API - Restful
app.factory('API', ['$http', function($http){
// API url
var apiURL = "/api/v1/";
// defuauly HTTP Headers
var defaultHeaders = {
"X-API-KEY": angular.getAPIKey()
"X-SOMETHING": "123"
};
@viezel
viezel / downloadManager.js
Last active March 13, 2016 19:04
Download Manager for Titanium using om.kcwdev.downloader
/**
* Download Manager
* Manage downloads of assets through a third party module
* It also keeps track of the downloaded files in a queue.
* Dependency: A native module for iOS & Android
* @author Mads Møller
* @version 1.0.0
* Copyright Napp ApS
* www.napp.dk
*/
@viezel
viezel / bugsnag.js
Last active August 29, 2015 14:01
bugsnag angular module
// bugsnag module
angular.module('napp-angular-bugsnag', []).run(['$rootScope', function($rootScope) {
$rootScope.$on('ServerException', function(evt, err) {
Bugsnag.user = {
id: napp.getUserId(),
name: napp.getUsername()
};
var exception = "ErrorException";
@viezel
viezel / build-module-android.sh
Last active August 29, 2015 14:01
Build and copy android module
##
## Build an Appcelerator Android Module
## Then copy it to the default module directory
##
## (c) Napp ApS
## Mads Møller
##
## HOW TO GUIDE
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- array of downloads. -->
<key>items</key>
<array>
<dict>
<!-- an array of assets to download -->
@viezel
viezel / app.js
Last active August 29, 2015 14:14
appcelerator - HTTP requsts queing system while being offline
//
// Start the app while being offline
// Then after these requests have been cache - go back online
//
var HTTPHelper = require("networkHelper");
// simulate some request while being offline
for(var i = 0; i < 5; i++){
setTimeout(function(){
//
// Start the app while being offline
// Then after these requests have been cache - go back online
//
// require this lib
var HTTPHelper = require("networkHelper");
// the http request will auto try to send queued requests when being online again
HTTPHelper.httpRequest({
@viezel
viezel / app.js
Created March 23, 2015 09:25
Example of how to use TiCollectionView
$.listView.addEventListener("contextMenuClick", function(e){
alert( "You clicked on menu item " + e.index + " - CollectionView item " + e.itemIndex );
});
$.listView.addEventListener("pull", function(e){
Ti.API.info(e);
});
$.listView.addEventListener("pullend", function(e){