Skip to content

Instantly share code, notes, and snippets.

Web technologies lover! ❤️

Miguel Ángel Durán midudev

Web technologies lover! ❤️
Block or report user

Report or block midudev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
midudev / 0_reuse_code.js
Created Oct 6, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
midudev / index.html
Created Jun 3, 2013
A CodePen by Miguel. Download button v.2 with entypo icon
View index.html
<a id="download" href="#"><span class="entypo-install"></span>Download kaxi<span id="version">min. 2kb</span></a>
midudev / index.html
Created Jul 3, 2013
A CodePen by Miguel. Which keycode is? - Discover which keycode is the key pressed. A simple script with pure JS to now the keyCode of the keyDown.
View index.html
<a href="//" title="Desarrollado por miduga para desarrolladores">Developed by miduga</a>
<div id="i">
Press a key<br/><span>And discover his keyCode to use it in your JavaScript projects.</span></div>
<div id="k"></div>
midudev / clearfix.styl
Last active Dec 20, 2015
Stylus mixin to do clearfix to an element.
View clearfix.styl
content ""
display table
clear both
midudev / testing_feedparser_ES6.js
Last active Aug 19, 2018
Example of using feedparser ( with ES6 on node.js >= 4.0.0
View testing_feedparser_ES6.js
'use strict'
const FeedParser = require('feedparser')
const request = require('request')
let req = request('')
let parser = new FeedParser()
req.on('error', (err) => {
// handle request error
midudev / using_map_and_filter.js
Created Oct 7, 2016
Example about how to use reduce to map and filter an array with one iteration
View using_map_and_filter.js
const multimedias = [
{ mediumSizeUrl: 'dog.jpg', typeId: 2 },
{ mediumSizeUrl: 'panda.jpg', typeId: 12 },
{ mediumSizeUrl: 'koala.jpg', typeId: 12 },
{ mediumSizeUrl: 'trex.jpg', typeId: 5 },
{ mediumSizeUrl: 'ratilla.jpg', typeId: 12 }
midudev / useLegacyState.js
Created Jun 17, 2019
quick'n'dirty state replacement that emulates the general behaviour of the old setState
View useLegacyState.js
// hook to emulate legacy state behaviour
const useLegacyState = (initialState = {}) => {
const [state, setState] = useState(initialState)
function setLegacyState (partialNewState) {
let newState = {...state}
if (typeof partialNewState === 'object' && partialNewState !== null) {
newState = {...newState, ...partialNewState}
midudev /
Last active Nov 21, 2019
Make your OSX great again
# sh ./
# set keyboard repeat rate to 0, so instant
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
# instant quick look animation
defaults write -g QLPanelAnimationDuration -float 0
# increase speed of animation when resizing window of Cocoa apps
midudev / from-querystring-to-object.js
Created Apr 2, 2020
Transform from querystring to object
View from-querystring-to-object.js
// get the querystring from document object
const qs =
// create searchParams object
const searchParams = new URLSearchParams(qs)
// create a plain object using entries
const queryParamsObject = Object.fromEntries(searchParams.entries())
You can’t perform that action at this time.