A Pen by Mustafa Enes on CodePen.
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(input) { | |
class CSSRule { | |
constructor(cssText) { | |
this.raw = cssText | |
this.parsed = CSSRule.parse(cssText) | |
return this | |
} | |
static parse(cssText) { |
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() { | |
function engine(template, data) { | |
(template.match(/{\{(.+)\}\}/g) || []).forEach(variable => { | |
var pureVar = variable.replace(/(\{|\})/g, '') | |
var innerAccess = pureVar.split(/\./) | |
var finalValue = innerAccess.reduce((acc, curr) => acc[curr], data) | |
template = template.replace(variable, finalValue) | |
}) | |
return template |
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(input) { | |
class HTMLFragment { | |
constructor(htmlText) { | |
this.raw = htmlText | |
this.parsed = HTMLFragment.parse(removeWhitespace(htmlText)) | |
return this | |
} | |
static parse(htmlText) { |
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
new Array(50) | |
.join(' ') | |
.split(' ') | |
.map((n, i) => | |
('0' + (i * Math.floor(255 / 50)).toString(16)) | |
.slice(-2) | |
.repeat(3) | |
) |
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
if [[ -z `git status | grep "git add <file>"` ]]; | |
then | |
echo same; | |
else | |
echo changed; | |
fi |
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
nnoremap <leader>s ms"syiw:r !say <C-r>s<CR>`s |
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
"syiw |
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
<C-r>s |
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
nnoremap <silent> <leader>s :<C-u>call system('say ' . expand('<cword>'))<CR> |