Skip to content

Instantly share code, notes, and snippets.

{
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Solarized Dark",
"editor.renderWhitespace": "all",
"window.zoomLevel": 0,
"editor.tabSize": 2,
"window.menuBarVisibility": "toggle",
"vim.disableAnnoyingNeovimMessage": true,
"editor.renderIndentGuides": true,
"material-icon-theme.showUpdateMessage": false,
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c3c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{

Keybase proof

I hereby claim:

  • I am luismichel on github.
  • I am luismichel (https://keybase.io/luismichel) on keybase.
  • I have a public key ASDqB3hOK8ugC7yUwBF3FQVXxX0xMupLH7TXlQtPo4i50Qo

To claim this, I am signing this object:

@luismichel
luismichel / minifyColor.js
Last active August 29, 2015 14:25
This method reduces color strings to a minified version, e.g. '#FF00FF' outputs '#F0F', 'rgb(255, 0, 255)' also outputs '#F0F'.
function minifyColor(stringColor) {
var rgb, slicedString, hexString;
if(stringColor.indexOf('rgb') !== -1) {
slicedString = stringColor.slice(stringColor.indexOf('(') +1, stringColor.indexOf(')'));
rgb = slicedString.split(',');
var hex = rgb.map(componentToHex);
hexString = '#'+hex[0]+hex[1]+hex[2];
} else {
hexString = stringColor;