Skip to content

Instantly share code, notes, and snippets.

View santibecerra's full-sized avatar

Santiago Becerra santibecerra

  • InQBarna
  • España
View GitHub Profile
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active July 12, 2024 03:33
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@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.

@aaronksaunders
aaronksaunders / Flickr-Search-Example:-Using-Controller-As-syntax-and-ui-router-resolve.markdown
Last active May 10, 2017 20:04
Flickr Search Example: Using Controller As syntax and ui-router resolve

Flickr Search Example: Using Controller As syntax and ui-router resolve

Demo of loading images using the Flickr API with IonicFramework

showing ui-router functionality of controller as for cleaner looking code.

A Pen by aaron k saunders on CodePen.

License.

@mikaturunen
mikaturunen / gist:f0b45def06bc83ccea9e
Created January 31, 2015 09:45
One way of hooking a callback from Angulars specific scope to HTML elements onload event
// There is no direct way of binding angular to elements onload event as commonly the HTML elements onload="" attribute looks into the
// Javascript global name space (window.*) which is a big no-no. It used to be the norm back in the day of how to do things but with
// modern frameworks like AngularJs and the such the approach has changed a lot.
// This is just one example (and by no means the only way) of how to get Angular behave nicely with HTML elements onload event. As
// <iframe onload="test()"> looks into window.test for a callback we need to bound the onload event to look into provided angular scope
// for the callback.
// NOTE: Written in ES6
@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
@FokkeZB
FokkeZB / index.xml
Created January 21, 2014 18:13
Need a Window on IOS but a View on Android in Alloy?
<Alloy>
<Window module="xp.ui">
<Label>Hello World</Label>
</Window>
</Alloy>
@iskugor
iskugor / alloy.js
Created November 14, 2013 11:30
Alloy "isTablet" that detects iPad mini
Alloy.isTablet = Alloy.isTablet || (Ti.Platform.model.search(/ipad/i) > -1);
@FokkeZB
FokkeZB / alloy.js
Last active August 13, 2016 17:28
Quick #TiAlloy fix for windows being positioned under the status bar on #iOS7
// For iOS7 only, set the window's top to 20 so they start under the status bar.
Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0;
// Put me in: ~/Library/Application Support/Sublime Text 2/Packages/User/
[{
"id": "view",
"children": [{
"id": "layout",
"children": [{
"command": "set_layout",
"caption": "Custom: 3 Pane",
"mnemonic": "C",
@FokkeZB
FokkeZB / DOWNSIZE.md
Last active December 8, 2016 10:39
Automatically generate non-retina and Android images for Alloy projects

UPDATE: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets or an alloy.ymk using:

task("pre:load", function(event, logger) {
    require('ticons').assets();
});