Skip to content

Instantly share code, notes, and snippets.

View jerome-geek's full-sized avatar
πŸ”₯
Burning

jerome jerome-geek

πŸ”₯
Burning
  • GeekStudio
  • Seoul, Korea
View GitHub Profile
@jerome-geek
jerome-geek / ellipsis.css
Last active January 6, 2022 05:36
ellipsis
/* ellipsis css */
.ellipsis {
width: 100%;
display: block;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.ellipsis-2 {
@jerome-geek
jerome-geek / checkMobile.js
Last active December 14, 2021 01:00
Detect Mobile Device in JavaScript
const checkMobile = () => {
const userAgent = navigator.userAgent.toLocaleLowerCase();
if(userAgent.indexOf('android') > -1) {
return 'android';
}
if(userAgent.indexOf('iphone') > -1 || userAgent.indexOf('ipad') > -1 || userAgent.indexOf('ipod') > -1) {
return 'ios';
}
@jerome-geek
jerome-geek / symmetricDiff.js
Created September 12, 2021 09:38
Difference between arrays in JavaScript
/**
* Difference between arrays in JavaScript
* - This is called a symmetric difference
* - The element present is arr1 alone and elements present in arr2 alone combined
*/
const arr1 = [1, 2, 3, 4, 5, 6];
const arr2 = [3, 4, 5, 6, 7, 8];
// diffLeft is all the elements present only in arr1 and vice versa
@jerome-geek
jerome-geek / removeDuplicates.js
Created September 12, 2021 09:25
Remove duplicates from arrays by using Set
const fruits = ['🍎', '🍌', '🍌', 'πŸ‡', '🍎'];
console.log(fruits);
const uniqueFruites = [...new Set(fruits)];
console.log(uniqueFruites);
@jerome-geek
jerome-geek / .prettierrc.js
Last active June 17, 2022 04:33
settings
module.exports = {
tabWidth: 4, // νƒ­ λ„ˆλΉ„
printWidth: 80, // 쀄 λ°”κΏˆ ν•  폭 길이
semi: true, // μ„Έλ―Έμ½œλ‘  μ‚¬μš© μ—¬λΆ€
singleQuote: true, // single quote μ‚¬μš©μ—¬λΆ€
trailingComma: 'all', // μ—¬λŸ¬ 쀄을 μ‚¬μš©ν•  λ•Œ, ν›„ν–‰ 콀마 μ‚¬μš© 방식
htmlWhitespaceSensitivity: 'ignore', // HTML 곡백 감도 μ„€μ •
spaceBeforeFunctionParen: true, // function keyword μ•žμ— 곡백을 넣을지 μ—¬λΆ€
proseWrap: 'preserve', // markdown ν…μŠ€νŠΈμ˜ μ€„λ°”κΏˆ 방식 (v1.8.2)
jsxSingleQuote: true, // JSX에 singe μΏΌν…Œμ΄μ…˜ μ‚¬μš© μ—¬λΆ€
🌞 Morning 253 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 26.5%
πŸŒ† Daytime 563 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 59.0%
πŸŒƒ Evening 128 commits β–ˆβ–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 13.4%
πŸŒ™ Night 11 commits ▏░░░░░░░░░░░░░░░░░░░░ 1.2%