This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a id="download" href="#"><span class="entypo-install"></span>Download kaxi<span id="version">min. 2kb</span></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<a href="//miduga.es" 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clearfix() | |
&:after | |
content "" | |
display table | |
clear both |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const FeedParser = require('feedparser') | |
const request = require('request') | |
let req = request('https://github.com/danmactough.atom') | |
let parser = new FeedParser() | |
req.on('error', (err) => { | |
// handle request error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MULTIMEDIA_IMAGE_TYPE_ID = 12 | |
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 } | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the querystring from document object | |
const qs = document.location.search | |
// create searchParams object | |
const searchParams = new URLSearchParams(qs) | |
// create a plain object using entries | |
const queryParamsObject = Object.fromEntries(searchParams.entries()) | |
console.log(queryParamsObject) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sh ./animations.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { beginBench } = require('@agarimo/bench') | |
const bench = beginBench({ | |
duration: 1000, | |
transactionsPerRun: 1000 | |
}) | |
bench.add('forEach', () => { | |
const array = Array.from({ length: 1000 }).map((x, i) => i) |
OlderNewer