Skip to content

Instantly share code, notes, and snippets.

@anabarasan
anabarasan / Quiz.html
Created December 12, 2012 05:34
The html used in Quiz for my company's Annual Day event.
<!doctype html>
<html>
<head>
<title>Quiz</title>
<style>
div{
width:100%;
text-align:center;
}
</style>
@anabarasan
anabarasan / gist:4482431
Created January 8, 2013 09:22
deployment into local setup
SET PATH=%PATH%;C:\Program Files\7-Zip
SET SILVERLIGHT_STORAGE=C:\Documents and Settings\Anbarasan\Local Settings\Application Data\Microsoft\Silverlight\is\5xgohmxj.bs4\fqkwck4v.z2m\1\s\
SET TRIAL=r02acfm3cu224ca0skencbzvxwuneikcsbtfedohx0ymfkgae3aaabga\f\
SET APPLICATION_ID=81f43b82c0af11df97a28d34bf5da969
REM 7z x "%SILVERLIGHT_STORAGE%%TRIAL%%APPLICATION_ID%\app.zip" -o"D:\EasyEclipse\workspace\TestRuntime" -y > deploy.log
echo %DATE% %TIME% >deploy.log
7z x "%SILVERLIGHT_STORAGE%%TRIAL%%APPLICATION_ID%\app.zip" -o"D:\OrangeScape\bogzilla" -y >> deploy.log
@anabarasan
anabarasan / backupLog.sh
Last active December 11, 2015 12:58
Compress & Backup log file
#####################################################################
# Script to compress and back up deployment server log file.
#####################################################################
# CONFIG
# Define the nohup file location and the location to backup the file
logFileName="nohup.out"
nohupDirectory="/home/ubuntu/DeployServer/Tornado/deploy"
backupDirectory="/home/ubuntu/DeployServer/Tornado/deploy/logBackup"
@anabarasan
anabarasan / jsonformatter.js
Last active December 12, 2015 04:08
json formatter script
/*
jsonformatter.js
usage
construct html table out of given JSON
var html = json2html(json);
format json and use output in editable text containers
var formattedJSONText = formatJSON(json,'text');
format json and use output in divs
var formattedJSONText = formatJSON(json,'html');
*/
@anabarasan
anabarasan / GenerateImportJson.py
Last active December 29, 2015 01:49
Script to generate JSON from a csv file with FieldName and Field Type information to be used in OrangeScape Visual PaaS for creating Model
# GenerateImportJson.py
# generates the JSON to be used to create model using the Import Json Functionality
# Anbarasan <nasarabna@gmail.com>
# usage GenerateImportJson.py <ModelName> <path to Model params csv file>
import json, sys
modelName = sys.argv[1]
paramsFile = sys.argv[2]
@anabarasan
anabarasan / GenerateOrangeScapeModelJson.py
Created November 22, 2013 10:48
Generate orangescape model json which can be used to create models in orangescape studio, from Excel File containing the field information
# GenerateJson.py
# generates the JSON to be used to create model using the Import Json Functionality
# requires xlrd library, which can be obtained from https://pypi.python.org/pypi/xlrd/0.9.2
# xlrd documentation => http://www.lexicon.net/sjmachin/xlrd.html
# Anbarasan <nasarabna@gmail.com>
# usage GenerateJson.py <path to Model params Excel file>
# In Excel :
# SheetName should be Model Name
# first column should be fieldname
# second column should be field type
@anabarasan
anabarasan / modal.dialog.html
Last active August 29, 2015 13:57
simple modal dialog
<!DOCTYPE html>
<html>
<head>
<style>
.angular-modal-backdrop {
position:fixed; top:0; left:0; width:100%; height:100%;
background-color:rgba(0,0,0,0.8); z-index:10; }
.angular-modal-dialog {
position: fixed; width: auto; top: 50%; left: 50%;
background-color: #fff; box-shadow: 4px 4px 80px #000;
@anabarasan
anabarasan / compare.js
Last active August 29, 2015 14:19
compare function for use in Array.sort()
function compare(property, reverse) {
return function cmp(obj1, obj2) {
if (property) {
obj1 = obj1[property];
obj2 = obj2[property];
}
if (typeof obj1 === 'string' || obj1 instanceof String) {
var result = obj1.localeCompare(obj2);
return reverse ? 0 - result : result;
@anabarasan
anabarasan / pong.html
Created July 2, 2015 13:01
pong in javascript
<html>
<!-- https://robots.thoughtbot.com/pong-clone-in-javascript -->
<head>
<script src="pong.js"></script>
</head>
<body style="width:99%; text-align:center;"></body>
</html>
<!doctype html>
<html>
<head>
<title>Space Rangers</title>
<script src="space_ranger.js"></script>
<style>
canvas { display:block; margin:0px auto; }
</style>
</head>
<body style="width:99%;">