Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="pt-BR">
<head>
<meta charset="utf-8" />
<title>align center with table-container</title>
<style>
body{
margin: 0;
padding: 0;
border: 0;
//input: jsonToArray({a: 1, b: 2 , c: 3});
//output: [ ['a', 'b', 'c'], [1, 2, 3] ];
function jsonToArray(obj){
let returnArray = [];
let key = [];
let values = [];
for( let thisKey in obj ){
//console.log( thisKey + ': ' + obj[thisKey] );
key.push( thisKey );
values.push( obj[thisKey] );
jQuery.fn.extend({
getParent: function(selector){
if( typeof selector == 'string' ){
//if number in string
if( !!selector.match(/(\d|\.)/g) ){
if( selector.length == selector.match(/(\d|\.)/g).length ){
return $(this).getParent( Number(selector) );
};
//jQuery_if_landscape.js
let landscape = $(window).innerWidth() >= $(window).innerHeight() ? true : false;
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, user-scalable=yes, shrink-to-fit=no" />
<title></title>
<!-- LIBS -->
.wpb_custom_raw_html{
border: 0;
padding: 0;
}
.wpb_custom_raw_html > .container{
width: 100%;
padding: 0;
}
.wpb_custom_raw_html > .container > .wpb_column > div{
padding: 0;
let array = ['a', 'b', 'c'];
array.forEach(function( item, index ){
console.log( item, index );
});
@luislobo14rap
luislobo14rap / getLink.js
Last active August 12, 2019 04:30
getLink.js
/* https://davidwalsh.name/detect-scrollbar-width */
.scrollbar-y-measure{width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px}
@luislobo14rap
luislobo14rap / bs-btn.css
Last active May 4, 2018 15:06
bootstrap buttons without background-colors and box-shadow
.btn:not(.btn-default):not(.btn-primary):not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-danger):not(.btn-link){
background-color: rgba(0, 0, 0, 0);
white-space: normal;
}
.btn:focus:not(.btn-default):not(.btn-primary):not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-danger):not(.btn-link){
box-shadow: none;
white-space: normal;
}