Skip to content

Instantly share code, notes, and snippets.

View brosig's full-sized avatar

Artur Brosig brosig

  • @universoimpulso
  • Goiânia - Goiás - Brasil
  • X @brosig
View GitHub Profile
@brosig
brosig / debug-hover.js
Last active July 13, 2020 11:23
Script to help debugging hover elements such mat-tooltip
/**
* Abra o console do chrome, adicione o script a seguir.
* Coloque o foco na janela principal do browser, faça o hover no elemento desejado e aperte a tecla 'd'
* O script vai disparar o modo debug e 'paralizar' tudo. Inspecione à vontade.
*/
window.addEventListener('keydown', function(e) {
if (e.keyCode == 68) debugger;
});
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@brosig
brosig / SCSS.md
Created June 10, 2019 19:51 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@brosig
brosig / getCKEditorText.js
Created November 13, 2018 11:41
Get text from CKEditor instance without HTML tags
function getCKEditorText(instance){
//var text = CKEDITOR.instances[instance].getData();
//text = $(text).text(); // html to text
//text = text.replace(/\r?\n|\r/gm," "); // remove line breaks
//text = text.replace(/\s\s+/g, " ").trim();
//return text;
return $(CKEDITOR.instances[instance].getData()).text().replace(/\r?\n|\r/gm," ").replace(/\s\s+/g, " ").trim()
}
@brosig
brosig / clean-up-boot-partition-ubuntu.md
Created May 9, 2018 13:08 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@brosig
brosig / cross-browser-multiline-ellipsis-scss.markdown
Last active March 19, 2018 12:37
Cross browser multiline ellipsis/SCSS