Skip to content

Instantly share code, notes, and snippets.

View manichandra's full-sized avatar

Manichandra manichandra

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
div {
margin-bottom: 10px;
position: relative;
@manichandra
manichandra / localStorageMock.ts
Created May 4, 2020 15:48 — forked from wzr1337/localStorageMock.ts
Mock localStorage for jasmine tests in TypeScript. This is the testing script. Copy the parts between snip and snap to mock your localStorage
/// <reference path="../../library.test.d.ts"/>
import * as angular from "angular"; angular;
import * as mocks from "angular-mocks/ngMock"; mocks;
describe('feat(localStorage Mock): ', function() {
beforeAll(() => {
angular.module('mock-module',[])
});
@manichandra
manichandra / terminal-git-branch-name.md
Created January 24, 2020 03:57 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@manichandra
manichandra / console-polyfill.js
Created June 21, 2019 14:46 — forked from cookiengineer/console-polyfill.js
A better console API for node.js, with support for all data types and pretty-printing using shell color codes
(function() {
let _std_out = '';
let _std_err = '';
/*
* HELPERS
@manichandra
manichandra / gist:a3328af5d22144afa4d023a82206d22a
Last active August 7, 2018 18:23
Create a fixed button in CSS with expanding hover animation

1. Create a fixed button in CSS with expanding hover animation

If you need to have a button with minimal information and when the user hover this one give more input before executing the action, here is something interesting. The code illustrates a use case that the button is fixed to the browser at the bottom-right of the screen but this kind of button can be used everywhere. The main purpose is to have a rich user experience with pro-active feedback in a minimal way. The initial state of the button is just a single icon. PlusImage For that example, I haven’t use a glyph icon, neither an image, just a single plus character. This could be replaced with what ever you want. The idea is that when the user hover the icon that we have a transition to a bigger button.

Here is the button’s Html. The container is not required and is just there for the purpose of having this button sticky at the bottom-right of the window. The button element is the real button. This one will grows when hovering. It contains two tex

@manichandra
manichandra / object-equal.md
Created March 8, 2018 15:48 — forked from MSAJJAN-EEOC/object-equal.md
Check if two arrays or objects are equal with JavaScript

What we need to compare

You could have a simple array, like this one.

var arr = [1, 2, 3, 4, 5];

Or, you could have a complex, multidimensional array with various types of inputs.

var arr = [1, 'something', 3, {
	item1: 42,
	item2: 'another thing',

item3: function () {

@manichandra
manichandra / multiple_ssh_setting.md
Created March 8, 2018 15:36 — forked from MSAJJAN-EEOC/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@manichandra
manichandra / multiple_ssh_setting.md
Created August 29, 2017 21:56 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"