teleren/devto huggingface dataset:
How to remove multiple attributes in jquery?
Tags: javascript, jquery, webdev, tutorial
Published: 2021-11-23 14:42:14

---
title: How to remove multiple attributes in jquery?
published: true
date: 2016-04-29 06:22:24 UTC
tags: Javascript,jQuery,Webdev,tutorial
canonical_url: https://www.moreonfew.com/how-to-remove-multiple-attributes-in-jquery/
---

Many a time you might have come across a scenario where you would want to remove multiple attributes from an element. For example, consider the following DIV :

```html
<div id="#rightSection" data-id="xyz" data-module="abc"> .... </div>
```

Now using jQuery’s removeAttr() method you want to remove both the data-id and data-module attributes. Many of us try to use multiple calls to the removeAttr() method by using jQuery’s chaining feature. Something like $(‘#rightSection’).removeAttr(‘data-id’).removeAttr(‘data-module’). However, while this may work, this is not a very optimal way to write the code.

## So, How do I remove multiple attributes or How do I Combine multiple .removeAttr() statements?

The answer to that is very easy one. You can **remove multiple attributes in jQuery by separating them using spaces**. This means that you would have to pass all the attributes you want to remove, separated by space, to the removeAttr() method. So now your code should look similar to the following :

```javascript
$("#rightSection").removeAttr('data-id data-module');
```

This way, you don’t have to repeat the .removeAttr() method to remove each attribute individually. And now you can actually Write Less and Do More ![🙂](https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png) 

Do let us know if you liked the solution. Please like and share and help your friends to learn about this !

The post [How to remove multiple attributes in jquery?](https://www.moreonfew.com/how-to-remove-multiple-attributes-in-jquery/) first appeared on [MoreOnFew](https://www.moreonfew.com).
Creating a Date Dimension Table in PostgreSQL
Tags: postgres, database
Published: 2020-02-07 13:40:37

---
title: Creating a Date Dimension Table in PostgreSQL
published: true
tags: postgresql, postgres, databases
canonical_url: https://duffn.github.io/postgresql-date-dimension/
cover_image: https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Postgresql_elephant.svg/1000px-Postgresql_elephant.svg.png
---

If you’ve ever read any of [Ralph Kimball’s data warehouse books](https://www.kimballgroup.com/) or have any experience with modeling data in the Kimball style, you know that a date dimension is a key part of any star schema. You probably found resources for creating Oracle, SQL Server or MySQL but may have had difficulty finding SQL to create a date dimension table for PostgreSQL. Here’s a bit of code adapted from the [PostgreSQL wiki](https://wiki.postgresql.org/wiki/Date_and_Time_dimensions) that I like for creating the ever necessary date dimension in PostgreSQL.

{% gist https://gist.github.com/duffn/38449526e00abb47f4ec292f0491313d %}
Android — Aprendiendo Kotlin para desarrollar Android apps
Tags: android, kotlin, spanish
Published: 2019-09-30 22:47:38

---
title: Android — Aprendiendo Kotlin para desarrollar Android apps
published: true
tags: android,kotlin,spanish
canonical_url: https://medium.com/kotlin-dev-reactor/android-aprendiendo-a-desarrollar-usando-kotlin-283fe9956788
---

![](https://cdn-images-1.medium.com/max/250/1*jA64NTovT-efZ96tcq-X5g.png)<figcaption>Logo de Kotlin</figcaption>

De un tiempo a esta parte, vengo con la tarea de aprender a desarrollar aplicaciones Android empleando como lenguaje de programación [Kotlin](http://kotlinlang.org/), un lenguaje de programación desarrollado por el equipo de JetBrains.

En un principio pasó medio desapercibido para mi hasta que en un par de ocasiones recibí ofertas de trabajo como desarrollador Android en los que me pedían conocer este lenguaje de programación. Esto, además de saber que varios colegas ya lo vienen empleando de forma profesional, me llevaron a conocer más sobre este lenguaje de programación.

#### ¿Por qué aprender a programar con Kotlin?

Muy aparte de las razones listadas anteriormente y las que se listan en la propia web [https://kotlinlang.org/](https://kotlinlang.org/) (como la facilidad de su aprendizaje, la interoperabilidad con Java, su versatilidad entre otras cosas), quisiera agregar un par de razones: **_el equipo de JetBrains esté detrás del mismo_** , lo cual me brinda la tranquilidad de que tendré el soporte necesario para hacer uso del lenguaje y porque **_nace como resultado de la experiencia_** (aciertos y desaciertos) **_de trabajar con java en el campo profesional_** ; por ello, cuando lo aprendes irás dándote cuenta que te facilita muchísimo el trabajo y nos ayuda a resolver diversas situaciones en el día a día.

Entonces, no vendría mal ir aprendiendo más sobre el mismo.

#### Menos cháchara y más código

Como para que se vayan haciendo una idea de cómo va el tema del código, estoy trabajando sobre una pequeña demo que ve algunos aspectos básicos en el uso del lenguaje, les dejo a continuación el enlace del proyecto: [https://github.com/DevPicon/kotlin-marvel-hero-finder](https://github.com/DevPicon/kotlin-marvel-hero-finder)

[DevPicon/kotlin-marvel-hero-finder](https://github.com/DevPicon/kotlin-marvel-hero-finder)

Así es como va luciendo la aplicación hasta el momento:

![](https://cdn-images-1.medium.com/max/320/1*6BoCpNlG2rLY1ZY-bN_n1g.gif)

* * *
Set Up PHP Coding Standards Fixer for Sublime Text 3 on OS X
Tags: php, laravel, sublimetext, phpcsfixer
Published: 2018-01-11 19:35:06

---
title: "Set Up PHP Coding Standards Fixer for Sublime Text 3 on OS X"
published: true
tags: php,laravel,sublime text,php-cs-fixer
canonical_url: 
---

You can save yourself quite some time by running a simple command to automatically format your PHP/Laravel code to follow the PSR-1 and PSR-2 standards. Let me show you how you can set it all up to work with Sublime Text 3 on OS X.

## Install php-cs-fixer

You must have at least `PHP 5.3.6` on your system. Check with `php --version`.

Run the following commands to download php-cs-fixer:

```
cd ~/Downloads
wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer
```

If you don’t have `wget` installed, [follow these instructions to install it](https://coolestguidesontheplanet.com/install-and-configure-wget-on-os-x/). Inspect [this page](http://ftp.gnu.org/gnu/wget/) so you can get the latest version.

or use `curl`:

```
curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer
```

If you prefer a different download method such as composer or homebrew, [check out these instructions](http://cs.sensiolabs.org/).

Now that you’ve downloaded php-cs-fixer, make it executable:

```
sudo chmod a+x php-cs-fixer
```

Move it to a global location:

```
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
```

Check that it works by running:

```
php-cs-fixer
```

If everything is fine, you should see the version and usage information.

## Configure a Build Command in Sublime Text 3

- Open Sublime Text
- Got to Tools \> Build System \> New Build System…
- Enter the following command and save:

```
{
    "shell_cmd": "php-cs-fixer fix $file --level=psr2"
}
```

That’s it. When you run this command, php-cs-fixer will apply psr-2 standards to the current file you have open.

Run the command by pressing `Command + B`.

Cheers!
La importancia del diseño móvil en la web
Tags: responsive, design, spanish
Published: 2022-03-28 17:06:32

---
title: La importancia del diseño móvil en la web
published: true
date: 2016-03-30 12:58:48 UTC
tags: responsive,design,spanish
canonical_url: 
---

30 March 2016

> _Desde marzo de 2014 a 2015, los usuarios que únicamente emplean el ordenador de sobremesa para navegar en Internet se han reducido del 20% al 10%_

“El mundo tecnológico avanza a pasos agigantados” este cliché nunca ha sido más cierto como en la última década. Lo que ayer fue un hecho, hoy es obsoleto y esto se debe a la facilidad que tenemos para acceder a toda clase de información.

### Los tiempos cambian

![boy picture in multiple devices](https://cdn-images-1.medium.com/max/800/0*eCXjaRhkKKLNYHog.jpg)

Recuerdo que hace muchos años trabajaba en una Agencia de Viajes y unos profesionales viajaban a un congreso en Alemania y necesitábamos determinar que hotel era el más cercano al sitio donde se iba a desarrollar dicho congreso, como era el “encargado” de tecnología me encomendaron esta dura tarea, para la cual emplee [ICQ](https://icq.com) (el chat mas cotizado del momento) contacte varias personas que vivieran en Berlín que al menos hablaran inglés y logramos determinar cuál era la mejor opción, los pasajeros quedaron contentos al regresar de su congreso ¿Saben cuanto tiempo me tomó? **¡Casi dos días!** Tarea que ahora con [Google Maps](http://maps.google.com) la hubiera hecho en minutos.

### ¡Ah! pero yo tengo un sitio web

![responsive devices](https://cdn-images-1.medium.com/max/1024/0*RZiHqHr0pfklER-_.png)

El punto es, que hasta hace unos años bastaba con _tener_ un sitio web y estábamos con “el último grito de la moda”, en cambio ahora nuestro sitio debe adaptarse a **dispositivos móviles** y ahí muchos no resisten el análisis.

Además el mayor buscador web del mundo [Google](http://www.google.com) modificó su [algoritmo](http://www.marketingdirecto.com/digital-general/digital/el-nuevo-cambio-del-algoritmo-de-google-podria-danar-seriamente-a-millones-de-pequenas-empresas/) el año pasado dando mayor importancia en sus resultados a los sitios mobile friendly.

### ¿Y ahora quién podrá defenderme?

![Jackei Chan WTF](https://cdn-images-1.medium.com/max/1024/0*7mwWrhwR55nrlNJS.jpg)

No todo está perdido, nuestra empresa cuenta con profesionales en **diseño y desarrollo web** quienes podemos brindarte asesoría para una estrategia SEO para tu sitio web, [contactanos](https://codedebug.co/contactenos) ahora

_Originally published at codedebug.co on March 30, 2016._
I Hosted My First Technical Podcast
Published: 2016-03-28 14:08:27

<p>A little while back, I was asked to guest-host an episode of <a href="http://softwareengineeringdaily.com/" target="_blank">Software Engineering Daily</a>. I&nbsp;had never been a guest on a podcast or hosted one and the idea of hosting a technical podcast was making my imposter syndrome go wild, but in an effort to get over my insecurities in a hurry, I just said yes. In an alternate universe, my first attempt at podcast hosting would be heard by a dozen friends and family, but this trial by fire was on an established technical podcast listened to by thousands.</p>
<p>Software Engineering Daily listeners have high expectations about the&nbsp;discussions on the show and I felt great pressure to meet them.&nbsp;What if I have some huge technical blindspot that will be embarrassingly exposed during the interview? Not to mention having to hear the sound of my own voice once it is all put together.</p>
<p>Despite all my fears, recording the podcast was awesome and I learned a lot in the hour of recording. My guest was <a href="https://twitter.com/buritica" target="_blank">Juan Buritica</a>, VP of engineering at <a href="https://ride.com/" target="_blank">Ride</a>, and the whole discussion was great. There was a lot I could have done better. I may have strayed too far from some of the technical issues because I was very interested in some of the management choices Juan makes on a daily basis, but so much of software engineering is about the people and the interactions so I felt personally that this direction provided a lot of value.</p>
<p>I truly&nbsp;learned&nbsp;a ton&nbsp;during the interview about how Juan organizes his engineering team at Ride and why they made some of the technical decisions they made. Juan's team is distributed across the USA and Latin America, as Juan, who is Colombian, has been&nbsp;able to take advantage of his network to assemble a very talented and diverse distributed team. The episode went out today and <a href="http://softwareengineeringdaily.com/2016/03/27/microservices-distributed-teams/" target="_blank">here it is</a>.</p>
<p>If you want to host a technical podcast, here is my advice:</p>
<ol>
<li>Do it, it will be easier than you think.</li>
<li>Do not spend too much time joking around or making small talk. Get to the meat.</li>
<li>Ask questions in order to genuinely learn something. Chances are others will benefit from this as well.</li>
</ol>
Create a Quote Box with HTML and CSS
Tags: html, css, quote
Published: 2018-01-11 19:33:51

---
title: "Create a Quote Box with HTML and CSS"
published: true
tags: html,css,quote,CSS
canonical_url: 
---

I came across a site that displayed a quote in a box, you know, the one with a little triangle thing at the bottom to indicate dialog or something. I’ve never worked on a project that required me to style a quote in this way, so I was curious to know how to create one. Here’s a preview of what I came up with:

![Quote box example](http://www.mariorodriguez.co//assets/img/posts/quote-box.png)

## HTML

First, I needed some markup to set the whole thing up. I wrapped everything in a `container` class just to control the size for this demo:

```
<div class="container">
    
</div>
```

Then I added a wrapper class for the quote, I called it `quote-box`:

```
<div class="container">
    <div class="quote-box">
        
    </div>
</div>
```

And then the actual quote split in two areas, quote text and name, styled by the classes `quote` and `name` respectively:

```
<div class="container">
    <div class="quote-box">
        <div class="quote">
            <blockquote>
                "The secret of getting ahead is getting started. The secret of getting started is breaking your complex overwhelming tasks into small manageable tasks, and starting on the first one."
            </blockquote>
        </div>
        <div class="name">
            Mark Twain
        </div>
    </div>
</div>
```

## CSS

I applied some styling to the quote text and the name:

```
/* Contain demo size */
.container {
    width: 400px;
}

.quote {
    background-color: #6b936a;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #fff;
    margin: 0;
    padding: 20px;
    font-size: 20px;
}

.name {
    background-color: #333;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    color: #fff;
    font-size: 20px;
    padding: 20px;
    text-align: center;
}

/* Reset */
blockquote {
    padding: 0;
    margin: 0;
}
```

Nothing special so far. Here’s what will transform this box into a “quote” box. The following CSS creates a triangle looking thing by taking advantage of the way borders behave. I do that by creating an element after the quote that has no width or height but has a thick border. Styling the border color strategically creates a triangle. Then I positioned half of this triangle just below the quote and done! The position is relative so it can “move” with the box for responsiveness:

```
blockquote::after {
    border-color: transparent #6b936a transparent transparent;
    border-image: none;
    border-style: solid;
    border-width: 20px;
    top: 40px;
    content: " ";
    display: block;
    right: 75%;
    position: relative;
}
```

Here’s the whole thing put together. Feel free to change it around and make it yours.

See the Pen [yObrMv](http://codepen.io/mariordev/pen/yObrMv/) by Mario Rodriguez ([@mariordev](http://codepen.io/mariordev)) on [CodePen](http://codepen.io).

<script async="" src="//assets.codepen.io/assets/embed/ei.js"></script>

Happy coding!
In Programming, Humanity is Law
Published: 2016-03-23 14:41:50

<p>When I went to build and deploy my code to Heroku yesterday, I typed <code>git push heroku master</code>, and had no reason to believe the push would be rejected. To my surprise, the build failed with this error.</p>
<pre>npm ERR! No compatible version found: left-pad@0.0.3</pre>
<p>Confused, I Googled the error message, and instead of finding one random Github issue, I realized this was being discussed all over the web, discussions like <a href="https://github.com/facebook/react-native/issues/6595" target="_blank">this one</a> in the React Native community. One dependency had been mysteriously removed from NPM that broke some modules that everybody uses. The issues got fixed fairly quickly, but the cause is still remarkable. One programmer unpublished his modules because he was rightfully pissed off at NPM for how they handled a legal threat. One of his modules, 11 lines of code, caused a glitch in the entire matrix.</p>
<p>The system we rely on, remarkably, works pretty well even though it is basically built on a house of cards. One angry solo programmer was able to break builds for, perhaps, millions of developers.</p>
<p>Programmers have a habit of seeing their craft as deterministic, technical, logical, and less about the emotions and uncertain actions of humans than it really is. The community has seen this thought process play out in the form of obnoxious refusals to acknowledge moral responsibilities, like in a discussion in the <a href="http://opalrb.org/" target="_blank">Opal</a> community about a transphobic contributor.</p>
<blockquote>
<p>Also to elaborate more on that, Opal is a technology, technology is moral-less, if a transgender contributor appeared @elia's views wouldn't even appear in here, because why would anyone care, bring contributions, they will be accepted with open arms, bring morals and politics in here, and you will be shown the metaphorical door.<br /><a href="https://github.com/opal/opal/issues/941" target="_blank">source</a></p>
</blockquote>
<p>The truth is, as I believe this latest incident reflects, programming outcomes are anything but moral-less, and anything but deterministic. The NPM ecosystem was rocked by one developer&rsquo;s personal issues with the way he was treated. The programming world is becoming more and more like a global organism, one that can be affected and infected by humanity in the best ways, the worst ways, and everything in between. The liberal nature in which NPM packages can be published and removed creates great power and the need for great collective responsibility.</p>
<p>Open-source programming is a tremendous gift to the world, but the inherent humanity and contentious interplay between individuals, corporations, governments, etc, is so much more intricate than developers give it credit. Programs today are built upon the world&rsquo;s collective humanity and if you want to make accurate technology projections and ultimately make good choices and build good software, acknowledge the humanity.</p>
<h6><em>Cover image&nbsp;credit: <a href="http://wentzart.net/" target="_blank">John Wentz</a></em></h6>
Create a Dynamic Go-to-Top Button
Tags: html, css, javascript
Published: 2018-01-11 19:33:24

---
title: "Create a Dynamic Go-to-Top Button"
published: true
tags: html,css,javascript,CSS
canonical_url: 
---

Remember the “Back to top” links sprinkled between the content of a page back in the day? Yeah, those… Here’s a quick way to create a modern alternative, a floating dynamic “Go-to-Top” button. The button appears only after the user has scrolled down the page and it disappears once the user scrolls back up. I find a go-to-top button useful especially on mobile devices, where content is compressed in a smaller screen, making it taller and more tedious for the user to scroll back up to the top.

We only need some basic HTML, CSS and a bit of JavaScript to get a nice dynamic go-to-top button working. Check it out:

See the Pen [Go-to-Top Button](http://codepen.io/mariordev/pen/PNmZzG/) by Mario Rodriguez ([@mariordev](http://codepen.io/mariordev)) on [CodePen](http://codepen.io).

<script async="" src="//assets.codepen.io/assets/embed/ei.js"></script>

NOTE: This CodePen is loading jQuery for me, so just remember to load jQuery before the js code shown here.

Cheers!
Jekyll BoilerPack
Tags: static, jekyll, boilerplate
Published: 2018-01-11 19:32:44

---
title: "Jekyll BoilerPack"
published: true
tags: static,jekyll,boilerplate,Jekyll
canonical_url: 
---

Last week I released a Jekyll boilerplate I call [BoilerPack](https://github.com/mariordev/jekyll-boilerpack). After creating a few Jekyll projects I got tired of having to set everything up from scratch every time. It’s usually the same stuff that needs to be set in place, so I created Jekyll BoilerPack, a repo that contains all the usual boilerplate stuff to start a new Jekyll project.

BoilerPack comes pre-configured with the following tools so you can hit the ground running:

- Bootstrap 3 (Sass port)
- Font Awesome (loaded from CDN)
- Autoprefixer
- Grunt

It also has the following features right out of the box:

- Static navbar
- Sticky footer
- Old-browser warning notification
- Disabled-javascript notification
- Site-wide custom notification
- Dynamic go-to-top button

You’ll find detailed installation instructions and usage documentation on the [GitHub repo](https://github.com/mariordev/jekyll-boilerpack). Feel free to copy and modify as you please. I hope it’s as useful to you as it’s been to me.

Cheers!
Lumi
Tags: robots, tinysafeboot, lumi, c
Published: 2016-03-18 10:00:00

---
title: Lumi
published: true
tags: robots, tinysafeboot, lumi, c#
published_at: 20160318T10:00Z
series: Lumi
canonical_url: https://ladvien.com/lumi
main_image: https://ladvien.com/images/tsb_logo_svg.png
---
### Update 3/29/2016

I've begun re-writing the entire program as a Windows App.  Not really my choice.  It seems the BluetoothLE API Microsoft has thrown together (for-real-doh, it's super bad) is most easily adopted under the Windows Universal App toolchain.

Anyway, here's the resting space of the new projects

[Lumi](https://github.com/Ladvien/Lumi_Windows_App)

### Lumi for Desktop
Where I come from they having a saying: "Video or it didn't happen."  I've always liked that saying.  It means we have to put our work where our typing is.   Here is a video of the uploader I wrote to interface with the TinySafeBoot AVR two-wire (UART) bootloader.  

It was written with the idea a serial connection could be directly opened from the computer using Bluetooth 4.0. Or, if we get super fancy, using WiFi.  On the receiving end, connected to the AVR, would be an HM-10 or an ESP8266 respectively.  This would allow direct wireless uploading of Arduino sketches (or Atmel studio hex files) to the targeted Arduino (or AVR, if you will).

It has a couple of kinks, but I'm fairly pleased with it.  

For a little more information on the projects:

http://ladvien.github.io/robots/tsb/

The whole projects is named after my friend Lumi who passed away last year.  Amazing man with good taste in photography subjects. :)

Source Code:

https://github.com/Ladvien/Lumi_TinySafeBoot_Uploader