This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A. Target Safari | |
if( $.browser.safari ) {}; | |
//B. Target anything above IE6 | |
if ($.browser.msie && $.browser.version > 6 ) {}; | |
//C. Target IE6 and below | |
if ($.browser.msie && $.browser.version <= 6 ) {}; | |
//D. Target Firefox 2 and above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"deploy" : "ng build --prod --base dist && git add -A && git commit -m 'dist pushed' && git subtree push --prefix dist origin gh-pages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input:not(:focus):valid { | |
border: 1px solid green; | |
} | |
input:not(:focus):valid + span::after { | |
content: '✓'; | |
} | |
input:not(:focus):invalid { | |
border: 1px solid red; | |
} | |
input:not(:focus):invalid + span::after { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Rx from 'rxjs' | |
const Observable = Rx.Observable; | |
// App logic | |
const startButton = document.querySelector('#start'); | |
const stopButton = document.querySelector('#stop'); | |
const start$ = Observable.fromEvent(startButton, 'click'); | |
const interval$ = Observable.interval(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function email2csv(str){ | |
str.split(';').map(e => e.substr(0,e.length-1).split('<').map(i=>i.trim()).join(',')).join('\n') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CASE | |
WHEN u.first_name IS NULL AND u.last_name IS NULL THEN u.username | |
WHEN u.first_name = '' AND u.last_name = '' THEN u.username | |
ELSE u.first_name || ' ' || u.last_name | |
END as "name" | |
FROM users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h2 ~ p | |
article[class|="pillow"] | |
.soccer:not(h1) | |
td.student | |
section article > p a | |
li:only-child | |
h2:empty | |
div * | |
:root | |
.intro article::first-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx license mit > LICENSE && npx gitignore node && npx covgen me@imsarvesh.com && npm init -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isAnagrams = (str1,str2) => { | |
var charCount = new Map(); | |
for(var c of str1.split('')){ | |
charCount.set(c, (charCount.get(c) || 0) + 1); | |
} | |
for(var c of str2.split('')){ | |
if(!charCount.has(c)) return false; | |
charCount.set(c, charCount.get(c) - 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isAnyPermutationPalindrom = (str) => { | |
var charSet = new Set(); | |
for(var c of str.split('')){ | |
if(charSet.has(c)){ | |
charSet.delete(c) | |
} else { | |
charSet.add(c) | |
} | |
} |
OlderNewer