Skip to content

Instantly share code, notes, and snippets.

View narainsagar's full-sized avatar
👋
email me for projects or relocation roles!!

Narain M. narainsagar

👋
email me for projects or relocation roles!!
View GitHub Profile
@narainsagar
narainsagar / emoji
Created February 11, 2017 23:27 — forked from itsthatguy/emoji
All the emoji characters available for easy copy and paste (copy and paste into your favorite editor)
😁 😂 😃 😄 😅 😆 😉 😊 😋 😌 😍 😏 😒 😓 😔 😖 😘 😚 😜 😝 😞 😠 😡 😢 😣
😤 😥 😨 😩 😪 😫 😭 😰 😱 😲 😳 😵 😷 😸 😹 😺 😻 😼 😽 😾 😿 🙀 🙅 🙆 🙇
🙈 🙉 🙊 🙋 🙌 🙍 🙎 🙏 ✂ ✅ ✈ ✉ ✊ ✋ ✌ ✏ ✒ ✔ ✖ ✨ ✳ ✴ ❄ ❇ ❌
❎ ❓ ❔ ❕ ❗ ❤ ➕ ➖ ➗ ➡ ➰ 🚀 🚃 🚄 🚅 🚇 🚉 🚌 🚏 🚑 🚒 🚓 🚕 🚗 🚙
🚚 🚢 🚤 🚥 🚧 🚨 🚩 🚪 🚫 🚬 🚭 🚲 🚶 🚹 🚺 🚻 🚼 🚽 🚾 🛀 Ⓜ 🅰 🅱 🅾 🅿
🆎 🆑 🆒 🆓 🆔 🆕 🆖 🆗 🆘 🆙 🆚 🇩🇪 🇩🇪 🇩🇪 🇬🇧 🇬🇧 🇬🇧 🇨🇳 🇨🇳 🇨🇳 🇯
🇵 🇯🇵 🇯🇵 🇰🇷 🇰🇷 🇰🇷 🇫🇷 🇫🇷 🇫🇷 🇪🇸 🇪🇸 🇪🇸 🇮🇹 🇮🇹 🇮🇹 🇺🇸 🇺🇸
🇺🇸 🇷🇺 🇷🇺 🇷🇺 🈁 🈂 🈚 🈯 🈲 🈳 🈴 🈵 🈶 🈷 🈸 🈹 🈺 🉐 🉑 © ® ‼ ⁉
#⃣ #⃣ #⃣ ™ ℹ ↔ ↕ ↖ ↗ ↘ ↙ ↩ ↪ ⌚ ⌛ ⏩ ⏪ ⏫ ⏬ ⏰ ⏳ ▪ ▫ ▶
◀ ◻ ◼ ◽ ◾ ☀ ☁ ☎ ☑ ☔ ☕ ☝ ☺ ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓
@narainsagar
narainsagar / git-commands.md
Last active January 19, 2017 21:41
Git Quick, Useful & Easy Commands.

git useful commands

files to ignore tracking

.gitignore

an empty directory needs a file for git to keep track, convention way is to create a ".gitkeep" file

.gitkeep
@narainsagar
narainsagar / order_array.js
Last active November 20, 2016 22:32
Order Array of data based on activeIndex and clickedIndex elements.. (i.e., Images slider example)
/**
* Order Array of data based on single data...
* IDEA:
In Images Slider example we'd have collection of images data and one one image will be shown as default active (to be shown always).
Now when we click on anyother image that will be active and other images will be ordered according. we will be order all images in a way that
all images will be viewing in cycle (from both sides).
**/
/**
@narainsagar
narainsagar / ordinal.js
Created November 15, 2016 21:33
Ordinal numbers
function ordinalParse() {
return /\d{1,2}(st|nd|rd|th)/;
}
function ordinal(number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
@narainsagar
narainsagar / angular2-password-matching.md
Created November 15, 2016 13:12
solution for the password/confirm password matching.

solution for the password/confirm password matching:

matchingPasswords(passwordKey: string, passwordConfirmationKey: string) {
    return (group: FormGroup) => {
      let passwordInput = group.controls[passwordKey];
      let passwordConfirmationInput = group.controls[passwordConfirmationKey];
      if (passwordInput.value !== passwordConfirmationInput.value) {
        return passwordConfirmationInput.setErrors({passwordMismatch: true});
 }
@narainsagar
narainsagar / regex.md
Last active October 28, 2016 09:48
Sample Regular Expressions

Whole Numbers

Regex to validate all whole numbers only i..e, [0, 1, 2, 3, ....].

(0|[1-9][0-9]*)

Natural Numbers

Regex to validate all natural (psoitive whole) numbers i..e, [1, 2, 3, ....] sometimes 0 as well.

including zero (0): (0|[1-9][0-9]*)

@narainsagar
narainsagar / dom_jquery_swap_elements
Last active October 8, 2016 23:33
Swap two DOM elements using jQuery (Events and a possible focus or Bindings wouldn't be lost during/after swapping!)
/* A very simple and nice function to swap DOM elements */
// Solution #1
function swap($elementA, $elementB) {
var temp = $('<div>').insertAfter($elementA);
$elementA.insertAfter($elementB);
$elementB.insertBefore(temp);
temp.remove();
}
@narainsagar
narainsagar / unix-current-time.md
Created October 5, 2016 17:14
javascript to convert and get unix (epoch / posix) timestamp.
@narainsagar
narainsagar / MyDevTools.md
Last active September 25, 2016 00:48
For MAC (OSX) - App Developer Tools Setup and Installation Guide.

Dev Tools Setup and Installation Guide

$ brew install phantomjs
$ brew install mongodb