Skip to content

Instantly share code, notes, and snippets.

View hkasera's full-sized avatar

Harshita hkasera

View GitHub Profile
@hkasera
hkasera / circlify.css
Last active January 4, 2016 21:59
Circlify can be used to create circular divs.
/* This makes the transition smooth.Add it globally. */
div {
-webkit-transition: all 0.3s ease-in-out 0s; /* Chrome, Safari 3.1+ */
-moz-transition: all 0.3s ease-in-out 0s; /* Firefox 3.5+ */
-ms-transition: all 0.3s ease-in-out 0s; /* IE 9 */
-o-transition: all 0.3s ease-in-out 0s; /* Opera 10.50-12.00 */
transition: all 0.3s ease-in-out 0s; /* Firefox 16+, IE 10+, Opera 12.10+ */;
}
.circular {
@hkasera
hkasera / mongo-struc.js
Created March 6, 2014 10:12
A script for mongo shell to get the collection structure.
var conn = new Mongo();
db = conn.getDB(<DB_NAME>);
var cursor = db.<COLLECTION>.find();
var items = [];
items = cursor.toArray();
var dbstruc = {};
for (var i = 0; i < items.length; ++i) {
var target = items[i];
getKP(target,dbstruc);
}
@hkasera
hkasera / Cell.js
Created June 13, 2014 16:35
A javascript code to get the excel cells array
var getCells = function (num) {
var cellArray = [];
for (var i = 0; i < num; ++i) {
cellArray.push(cellAt(i + 1));
}
return cellArray;
};
var cellAt = function (num) {
if (num <= 26) {
return String.fromCharCode(97 + num - 1);
@hkasera
hkasera / binaryTree.js
Last active August 29, 2015 14:02
Binary Tree in Javascript
var BinaryTree = function (val) {
'use strict';
this.val = val || null;
this.left = null;
this.right = null;
};
BinaryTree.prototype.create = function (num) {
'use strict';
var i;
for (i = 0; i <= num; i = i + 1) {
@hkasera
hkasera / SinglyLinkedList.js
Created June 17, 2014 18:11
Singly Linked List and related operations in javascript
var Node = function (val) {
this.val = val || null;
this.next = null;
};
var SinglyLinkedList = function () {
this.head = null;
this.tail = null;
};
@hkasera
hkasera / BST.java
Created September 5, 2015 11:03
Sorted Array to Binary Search Tree
class Node{
int val;
Node left;
Node right;
}
class Tree{
Node root;
}
@hkasera
hkasera / braceValidate.js
Created September 11, 2015 15:48
Validating a pair of braces
var a = "{{{}}}}";
var ts = [];
var mismatch = false;
for (var i = 0; i < a.length; ++i) {
if (a[i] === '{') {
ts.push('{');
}
if (a[i] === '}') {
if (ts.length == 0) {
mismatch = true;
@hkasera
hkasera / Mutltiple_SSH.md
Last active September 29, 2018 02:45
How to use multiple github accounts?

I have two accounts on github, one is personal account and other is office account. I typically face this problem to manage pushing to different repos using these different accounts.

I found a great way of doing it without any hassle.

Step 1 : Generate different ssh keys for both the accounts

Suppose my personal id is [email protected] and office account is [email protected]

Follow the steps mentioned here to generate ssh keys : https://help.github.com/articles/generating-ssh-keys/