Skip to content

Instantly share code, notes, and snippets.

View ovarunendra's full-sized avatar
🎯
Focusing

Varunendra Pratap Singh ovarunendra

🎯
Focusing
View GitHub Profile
@ovarunendra
ovarunendra / app.js
Last active August 29, 2015 14:07
simple ng-include example
/**
* Created by ovarunendra on 05-10-2014.
*/
// Code goes here
angular.module('MyApp', [])
.controller('MainCtrl', [function() {
var self = this;
self.template = 'first.html';
self.change = function(){
self.template = 'second.html';;
@ovarunendra
ovarunendra / main.html
Created October 30, 2014 17:54
ng-options inside ng-repeat
<html ng-app="notesApp">
<head><title>Notes App</title>
</head>
<body ng-controller="MainCtrl as ctrl">
<div>
<table border="1" style="width:300px">
<tr>
<th>id</th>
<th>name</th>
<th>age</th>
@ovarunendra
ovarunendra / add.html
Last active August 29, 2015 14:08
ng-options inside ng-repeat.....plunker link http://plnkr.co/4NFtMZ1BnDptMCBBEpA6
<h2>Add Page</h2>
@ovarunendra
ovarunendra / index.html
Last active August 29, 2015 14:08
Reusable template directive...demo plunker link: http://embed.plnkr.co/zDVkdtMO0qU9eCpO6euJ
<!doctype html>
<html ng-app="demoApp">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
<script src="script.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div ng-controller="DirectiveDemoCtrl as demoCtrl">
@ovarunendra
ovarunendra / main.html
Last active August 29, 2015 14:09
drop down menu and modal window...demo link... http://plnkr.co/Ng9g8m0WV8YT5741jwKE
<!DOCTYPE html>
<html ng-app="demoApp">
<head>
<link rel="stylesheet" href="style.css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
<script src="script.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
@ovarunendra
ovarunendra / README.txt
Created November 25, 2014 07:07
angular unit test case demo for controller....steps to follow,..please README.txt file
steps:
1- get angular.min.js file from //cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular.min.js
2- get angular-mocks.js file from //cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular-mocks.js
save these files to same location
3- run npm install
4- run node_modules/karma/bin/karma start
@ovarunendra
ovarunendra / index.html
Last active August 29, 2015 14:10
reusable template directive with rcForm validation.....plunkr link...http://embed.plnkr.co/EaZSt6fJtQ5JOq7dn9Bn
<!DOCTYPE html>
<html ng-app="LoginApp">
<head>
<link data-require="bootstrap-css@3.2.0" data-semver="3.2.0" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<script data-require="angular.js@1.3.3" data-semver="1.3.3" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
<script src="rcSubmit.js"></script>
<script src="loginApp.js"></script>
</head>
@ovarunendra
ovarunendra / diff.js
Created January 7, 2015 09:46
Difference between Service, Factory and Provider in AngularJS
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};
});
//factory style, more involved but more sophisticated
@ovarunendra
ovarunendra / main.py
Created January 12, 2015 21:16
Trie in Python
def createTrie(*args):
"""
Create a trie by given words.
"""
rootTrie = {}
for word in args:
temp_trie = rootTrie
for letter in reversed(word):
temp_trie = temp_trie.setdefault(letter, {})
temp_trie = temp_trie.setdefault('_leaf_', '_leaf_')
@ovarunendra
ovarunendra / Survey.py
Last active August 29, 2015 14:13
Survey...
import csv
import ast
from fractions import Fraction
dataList = []
class DceSurvey:
"""docstring for Survey"""
def setData(self):