This file contains 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
<!DOCTYPE HTML> | |
<html lang="it"> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.5.1.min.js"></script> | |
<script> | |
(function($){ | |
This file contains 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
#to show the apache running user, in a php file write | |
<?php echo(exec("whoami")); ?> | |
#Let's say it prints out XXX. now just run in your shell | |
$ sudo chown -R XXX:nogroup /path/to/wordpress/ |
This file contains 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 TruthTable = require('truthtable'); | |
var condition1 = true; | |
var condition2 = false; | |
var tt = new TruthTable(condition1, condition2) | |
.on('01', function() { | |
console.log('01'); | |
}) | |
.on('11', function() { | |
console.log('11'); | |
}) |
This file contains 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
/* | |
* Snippet to solve a common problem in Titanium: | |
* hiding a view inside a vertical layout | |
* Tested with Alloy, will work on plain-vanilla Titanium too (just check underscore reference) | |
*/ | |
/** | |
* hides a view nested into a layout=vertical container |
This file contains 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], |
This file contains 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 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 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 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 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'); | |
}); |
OlderNewer