Skip to content

Instantly share code, notes, and snippets.

View diorahman's full-sized avatar

Dhi Aurrahman diorahman

  • Cokelatia
  • Bandung
View GitHub Profile
@diorahman
diorahman / index.html
Created March 2, 2012 09:03
XMLHttpRequest POST
<html>
<head>
<script type="text/javascript">
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
@diorahman
diorahman / upload.html
Created March 2, 2012 11:18
Secure upload easyxdm
<!doctype html>
<html>
<head>
<title>easyXDM</title>
<script type="text/javascript" src="easyXDM.debug.js">
</script>
<script type="text/javascript">
/**
* Request the use of the JSON object
*/
@diorahman
diorahman / request.js
Created March 9, 2012 03:41
XMLHttpRequest on QML (GET)
var xhr = new XMLHttpRequest();
var item;
function setItem(aitem) {
item = aitem;
}
function abort() {
xhr.abort();
}
@diorahman
diorahman / server.js
Created March 9, 2012 04:00
Simple Restify Server
var restify = require('restify');
var options = {
name : "MyAwesomeJSONServiceServer"
}
var server = restify.createServer(options);
server.get('/data', function(req, res, next){
// number of data rows
@diorahman
diorahman / install.sh
Created March 9, 2012 04:06
Install restify
echo 'if you want to install it locally'
npm install restify
echo 'if you want to install it globally (system wide)'
npm install restify -g
@diorahman
diorahman / output
Created March 9, 2012 04:13
Simple Curl Output
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version
Access-Control-Expose-Headers: X-Api-Version, X-Request-Id, X-Response-Time
Server: MyAwesomeJSONServiceServer
X-Request-Id: 3f8729cc-bc40-4896-8454-0754c16473ed
Access-Control-Allow-Methods: GET
Connection: close
Content-Length: 1141
Content-MD5: p9MyAlAkxjMtOyCBDaaEuQ==
@diorahman
diorahman / curl
Created March 9, 2012 04:14
Curl data, with 10 numberOfRows
curl -i 'localhost:8000/data?numberOfRows=10'
@diorahman
diorahman / running-simple
Created March 9, 2012 04:24
Running service
node server.js
@diorahman
diorahman / params.js
Created March 9, 2012 04:34
worker parameter
var dummyParams = {
os: 'harmattan',
qt: '4_7_4',
token: '',
projectId: 'ef34fef6-6e03-452f-9700-c6ffdd3b059e',
userToken: 'PXyW25Do0uHn17E3E3BezoWxnp',
orderId : 'validOrderId', // set by server
app : {
name : "Campur Sari",
publisher : "CampurSari Inc",
~/MyDocs/Downloads $ dpkg -i ./notification-engine0-env-selector_1.0.1-_armel.deb
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
dpkg: requested operation requires superuser privilege