##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
#!/usr/bin/env bash | |
# This a simple bash script outlining the procedures to get macports on OS X | |
# to auto update weekly via the ~/Library/LaunchAgents/net.ipatch.macportsUpdate.plist | |
# The first step is to update the port files | |
echo "Step 1: Update port tree" | |
port selfupdate | |
# The second step is to upgrade the outdated |
'use strict'; | |
requirejs.config({ | |
shim: { | |
'bootstrap': { | |
deps: ['jquery'] | |
} | |
}, | |
paths: { | |
'jquery': [ |
process.title = require('./package').name; |
$(document) | |
.ajaxSend(function() { | |
$('#spinner').show(); | |
}) | |
.ajaxStop(function() { | |
$('#spinner').hide(); | |
}) | |
.ajaxError(function() { | |
$('#spinner').hide(); | |
$('#message').text('Error occurred'); |
var postForm = function(destination, fields) { | |
var form = $("<form/>",{"action":destination,"method":"post"}); | |
$.each(fields, function(name, value) { | |
form.append($("<input/>", {"type":"hidden", "name":name, "value":value})); | |
}); | |
//for this to work in FF, form must be appended to body - not necessary in WebKit | |
$("body").append(form); | |
form.submit(); | |
} |
##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
public static function callService($url, $postData) { | |
if(stripos($_SERVER['HTTP_HOST'], "localhost") !== FALSE) | |
$postData .= "&XDEBUG_SESSION_START=netbeans-xdebug"; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // return into a variable | |
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); | |
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REMOTE_ADDR']); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_POST, TRUE); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); |
( | |
$("<form/>",{"action":"index.php","method":"post"}).append( | |
$("<input/>", {"type":"hidden", "name":"logout", "value":"1"}) | |
) | |
).submit(); |
#To get the sudo password prompt | |
sudo ls | |
#Pay attention - the sudo is on the 'sh', not the 'curl' | |
curl http://npmjs.org/install.sh | sudo sh |
import urllib2 | |
import json | |
url = '<INSERT URL>' | |
data = { | |
'aaa': '7673336666', | |
'bbb': ['4544444445','xxxxxxx','334tttt890'], | |
'ccc': { | |
'ddd': 'on', | |
'eee': 5 |