This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is row data coming from db | |
var dataset = [{ | |
firstname: 'John', | |
lastname: 'Doe', | |
birth: '1986-02-09', | |
languages: ['en'], | |
sex: 'm' | |
}, { | |
firstname: 'Maria', | |
lastname: 'Rossi', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//those two instructions are equivalent | |
_.map(myArray, function(e){}); | |
_(myArray).map(function(e){}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.chain(obj) | |
.map(function(e){ | |
//my mapping operation | |
}) | |
.reduce(function(m, e){ | |
//my reducing operation | |
}) | |
.filter(function(e){ | |
//guess what? | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = ['mario', 'luigi']; | |
var lambda = function(elem){ | |
alert('Thanks ' + elem + ' but the princess is in another castle'); | |
}; | |
_.each(obj, lambda); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.each(['mario', 'luigi'], function(elem){ | |
alert('Thanks ' + elem + ' but the princess is in another castle'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task("pre:compile", function(event, logger) { | |
//a decorator for path.join that consider arrays as arguments | |
function superJoin() { | |
var args = Array.prototype.slice.call(arguments); | |
var p = []; | |
_.each(args, function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"localhost": "191.191.24.249", | |
"ts_port": "3000", | |
"geny_s4": "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920" | |
}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"android:s4": "appc ti build -p android --device-id \"$npm_package_config_geny_s4\"", | |
"android:s4:ts": "appc ti build -p android -d ./shadow/ --device-id \"$npm_package_config_geny_s4\"", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- that's the pursued implementation --> | |
<Alloy> | |
<MyComponent ns="require('myui')" id="mc1" foo="bar"> | |
<Label>That's my precious content!</Label> | |
</MyComponent> | |
<MyComponent ns="require('myui')" id="mc2" foo="bar"> | |
<Label>Another precious content!</Label> | |
</MyComponent> | |
</Alloy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TRACE] error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't move temporary file: /Users/emanuele/Documents/Workspace/titanium/kleur2/build/iphone/build/Debug-iphoneos/Kleur.app/Kleur to file: /Users/emanuele/Documents/Workspace/titanium/kleur2/build/iphone/build/Debug-iphoneos/Kleur.app/Kleur.lipo (Is a directory) | |
[TRACE] Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo emitted errors but did not return a nonzero exit code to indicate failure | |
[TRACE] GenerateDSYMFile build/Debug-iphoneos/Kleur.app.dSYM build/Debug-iphoneos/Kleur.app/Kleur | |
[TRACE] cd /Users/emanuele/Documents/Workspace/titanium/kleur2/build/iphone | |
[TRACE] export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:/Users/emanuele/.rvm/gems/ruby-2.1.2/bin:/Users/emanuele/.rvm/gems/ruby-2.1.2@global/bin:/Users/em |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parseUrl = function(url) { | |
var r = /^((http[s]?|ftp):\/)?\/?(([\w\-\.]+):([\w\-\.\$]+)@)?([^:\/\s]+)((\/\w+)*?(:([0-9]+))\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/; | |
var tmp = r.exec(url); | |
return { | |
original: tmp[0], | |
protocol: tmp[2], | |
username: tmp[4], | |
password: tmp[5], | |
host: tmp[6], |