Skip to content

Instantly share code, notes, and snippets.

View manumaticx's full-sized avatar
👌
i'm okay

Manuel Lehner manumaticx

👌
i'm okay
View GitHub Profile
@manumaticx
manumaticx / components.my-component\.js
Last active June 26, 2020 11:21
modified twice bug
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
init() {
this._super(...arguments);
this.onUpdate(false);
},
@manumaticx
manumaticx / pagingcontrol.js
Last active July 17, 2017 16:10
port of PagingControl Alloy Widget for Titanium Classic
/**
* Original Alloy Widget:
* https://github.com/manumaticx/pagingcontrol
*
* This implementation is a port for Classic Titanium.
* @author: Manuel Lehner
*/
var OS_ANDROID = Ti.Platform.osname === 'android';
@manumaticx
manumaticx / gruntfile.js
Created February 21, 2016 22:49
convert all MP4 files to MOV with ffmpeg and grunt
/**
* This is just a little helper I made when I had to convert a lot of MP4 files.
* Using ffmpeg this works fine but it just needed to be automated. Maybe this isn't the best
* solution, it's quick and dirty but I was happy with its results.
* The grunt script ran overnight to process about a hundred video files.
*/
module.exports = function(grunt) {
var _ = require('underscore');
@manumaticx
manumaticx / README.md
Last active July 11, 2020 14:07
Fading ActionBar in Titanium

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

@manumaticx
manumaticx / index.xml
Created September 19, 2014 08:49
Split ActionBar Alloy example
<Alloy>
<Window splitActionBar="true">
<Menu>
<!-- Action Items -->
<MenuItem icon="/images/ic_action_edit.png" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" />
<MenuItem icon="/images/ic_action_important.png" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" />
<MenuItem icon="/images/ic_action_labels.png" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS" />
@manumaticx
manumaticx / notification.js
Last active January 25, 2016 13:32
Normalized User Notifications
/*
* This is how I notify users about errors, confirmations etc.
* e.g.: "Wrong password", "Registration complete", ...
*
*/
module.exports = (function(){
var notification,
OS_IOS = 'iPhone OS' === Ti.Platform.name,
OS_ANDROID = 'android' === Ti.Platform.name;
@manumaticx
manumaticx / log1
Created March 6, 2014 10:38
Modules.Map: ERROR
[WARN] : dalvikvm: VFY: unable to resolve static field 918 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 918 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 913 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 909 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 923 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 920 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 917 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: V
@manumaticx
manumaticx / app.js
Last active June 8, 2016 16:23
Underline a word in a Ti.UI.Label
/**
* Underlines a single word of a label
* @param {Ti.UI.Label} _label
* @param {String} _word
*/
function underline(_label, _word) {
if (Ti.Platform.name === 'iPhone OS') {
var text = _label.getText();
var attr = Titanium.UI.iOS.createAttributedString({
text : text,
@manumaticx
manumaticx / index.js
Last active March 15, 2017 18:41
CommonJS location helper for Titanium
var location = require('location');
if (location.enabled){
if (location.hasAuth){
location.currentLocation(function(e){
alert(e.latitude + '; ' + e.longitude);
});
}else{
alert('need permission to access location service');
}
// Forked from https://gist.github.com/2417902 to fix a small bug
// -----
function PagingControl(scrollableView){
var pages = [];
var page;
var numberOfPages = scrollableView.getViews().length;
// Configuration
var pageColor = "#c99ed5";
var container = Titanium.UI.createView({