Skip to content

Instantly share code, notes, and snippets.

View creativeaura's full-sized avatar
🌴
On vacation

Gaurav Jassal creativeaura

🌴
On vacation
View GitHub Profile
@creativeaura
creativeaura / web-app.html
Created December 4, 2012 15:26 — forked from tfausak/ios-8-web-app.html
iOS web app icons & startup images
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title></title>
<!-- iPhone -->
<link href="http://taylor.fausak.me/static/images/apple-touch-icon-57x57.png"
R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">Comix Sample</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59">
@creativeaura
creativeaura / async.js
Created May 8, 2013 09:55
Async loading assets in javascript
(function(){
var s = document.createElement('link');
s.setAttribute('href','style.css');
s.setAttribute('rel','stylesheet');
s.setAttribute('type','text/css');
document.getElementsByTagName('head')[0].appendChild(s);
}());
(function() {
var tk = document.createElement('script');
@creativeaura
creativeaura / construtor.js
Created May 8, 2013 09:59
Constuctor pattern
/*jslint boss:true, browser: true, devel:true, nomen: true */
/*global $,jQuery, window, ActiveXObject, google, self, top, _*/
(function (exports, $) {
"use strict";
var NS = exports.NS || {};
/**
* ClassName Model Class
* @class
@creativeaura
creativeaura / package.json
Created May 8, 2013 11:17
Package JSON for nodejs projects
{
"name": "application-name",
"description": "A package using versioning best-practices",
"author": "Gaurav Jassal <gaurav@jassal.me>",
"dependencies": {
"colors": "0.x.x",
"express": "2.3.x",
"optimist": "0.2.x"
},
"devDependencies": {
# Start an HTTP server from a directory, optionally specifying the port
function server() {
# Default to port 8000
local port="${1:-8000}"
# Since the one-liner blocks, we open the browser beforehand. However, we want to
# wait just a couple of seconds since the server will not be ready just yet.
# Also, I think Linux users should be able to use 'xdg-open' ('open' is for OS X).
( sleep 2; open "http://localhost:${port}/" ) &
@creativeaura
creativeaura / server.py
Created May 9, 2013 10:34
Modifying Python's SimpleHTTPServer to accept directory aliases
import os
import posixpath
import urllib
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# modify this to add additional routes
ROUTES = (
# [url_prefix , directory_path]
['/media', '/var/www/media'],
@creativeaura
creativeaura / package.json
Created May 9, 2013 10:51
NodeJS Server to serve static HTML files
{
"name" : "ServeStaticContent",
"version" : "0.0.1",
"dependencies" : {
"express" : "3.x"
}
}
@creativeaura
creativeaura / plugin.js
Created June 5, 2013 14:04
Plugin Bootstrap
/**
* PluginName v0.0.1
* https://github.com/creativeaura/PluginName
* MIT licensed
*
* Copyright (C) 2013 http://gaurav.jassal.me - By Gaurav Jassal (@gauravjassal)
*/
(function (root, factory) {
if (typeof exports === 'object') {