Skip to content

Instantly share code, notes, and snippets.

[Boolean]
type: boolean
[Integer]
type: integer
[Real]
type: float
[String]
@anabarasan
anabarasan / .vimrc
Last active October 17, 2017 06:22
set nocompatible
filetype off
" include vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let vundle manage vundle
Plugin 'gmarik/Vundle.vim' " Vundle
Plugin 'tmhedberg/SimpylFold' " Code Folding
@anabarasan
anabarasan / Install Cloud9 on local or remote computer, server, or raspberry pi This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git
@anabarasan
anabarasan / hangman.py
Created August 10, 2015 12:59
hangman
import random
CATEGORY_LIST = ["Animals", "Countries", "Fruits", "Vegetables"]
CATEGORIES = {
"Animals": ["alligator", "bear", "camel", "cat", "cheetah", "chimpanzee", "cow", "crocodile", "deer", "dog",
"dolphin", "duck", "elephant", "fish", "fox", "frog", "giraffe", "goat", "hamster", "hippopotamus",
"horse", "kangaroo", "lion", "monkey", "octopus", "panda", "pig", "rabbit", "seal", "sheep", "snake",
"spider", "squirrel", "tiger", "wolf", "zebra"],
"Countries": ["Afghanistan", "Albania", "Algeria", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
"Azerbaijan", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Bermuda", "Bhutan",
<!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%;">
@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>
@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 / 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 / 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 <[email protected]>
# 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 / 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 <[email protected]>
# usage GenerateImportJson.py <ModelName> <path to Model params csv file>
import json, sys
modelName = sys.argv[1]
paramsFile = sys.argv[2]