Skip to content

Instantly share code, notes, and snippets.

View jalalhejazi's full-sized avatar
:octocat:
🐝 DevOps Experimentation | Continuous Learning 🐝

Jalal Hejazi jalalhejazi

:octocat:
🐝 DevOps Experimentation | Continuous Learning 🐝
  • Denmark
View GitHub Profile
@jalalhejazi
jalalhejazi / storkreds.html
Created April 10, 2013 18:05
html: Find storkreds i DK
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>
Find storkreds
</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css"
@jalalhejazi
jalalhejazi / curl.txt
Created April 11, 2013 15:43
cURL: SuperWebApps.dk > JSON API
/*
SuperWebApps.dk JSON API
@Jalal.Hejazi 2013
cURL 'http://superwebapps.dk/?json=core.info&controller=core&dev=1'
{
"status": "ok",
@jalalhejazi
jalalhejazi / detectmobilebrowser.js
Created April 14, 2013 16:14
jQuery: jQuery.browser.mobile will be true if the browser is a mobile device
jQuery.browser.mobile
@jalalhejazi
jalalhejazi / css3finalize.htm
Created April 15, 2013 19:35
CSS3: css3finalize
css3finalize
@jalalhejazi
jalalhejazi / MyEditor.htm
Created April 17, 2013 19:45
Editor: Offline CodeMirror Editor & hidden link
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
WebApp.Offline.Editor
</title>
<script src="http://codemirror.net/lib/codemirror.js">
@jalalhejazi
jalalhejazi / install_dependencies.sh
Created April 18, 2013 08:39
Install: $ sh install_dependencies.sh
# Download application dependency on the following components:
# * jQuery
# * JSrender (JavaScript Template Rendering for jQuery)
# * JSO (JavaScript OAuth 2 client)
# * Bootstrap CSS
# It can easily be installed by running the following script:
# $ sh install_dependencies.sh
@jalalhejazi
jalalhejazi / API_get_recent_posts.js
Created April 21, 2013 03:50
AJAX: SuperWebApps.dk API get_recent_posts JSON
//http://jsfiddle.net/jalalhejazi/wWPs5/
$(function () {
//Add ul html to body
$('body').html('<ul id="results">');
//Call JSONP to CORS SuperWebApps.dk/API REST.get
$.ajax({
type: 'get',
dataType: "jsonp",
@jalalhejazi
jalalhejazi / CORS.js
Created April 22, 2013 12:53
Nodejs: CORS support in Node server.js
// please read before code any CORS:
// http://john.sh/blog/2011/6/30/cross-domain-ajax-expressjs-and-access-control-allow-origin.html
// http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs
//
setHeaders = function (req,res,next) {
res.header("X-Powered-By","nodejs");
// if ajax set access control
@jalalhejazi
jalalhejazi / app.js
Created April 22, 2013 13:02
Node: Create Simple NodeJS server reading a file from fileSystem
var http = require('http');
var fs = require('fs');
http.createServer(function(request, response) {
response.writeHead(200, {
'Content-Type': 'text/html'
});
fs.readFile('index.html', function(err, content){
response.write(content);
@jalalhejazi
jalalhejazi / app.js
Created April 22, 2013 14:06
nodejs: Node create server and send data.json filecontent to client of CORS !
/*
Response header info:
Access-Control-Allow-Origin:*
Content-Type:text/json
X-Powered-By:nodejs
*/
var http = require('http');
var fs = require('fs');