function daysInMonth (date = new Date()) {
const m = new Date(date)
return new Date(m.getFullYear(), m.getMonth() + 1, 0).getDate()
}
daysInMonth()
> 30
daysInMonth('Wed, 15 Feb 2017 22:11:32 GMT')
> 28
This file contains hidden or 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
{"traceEvents":[{"pid":18981,"tid":1,"ts":5358359720,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":38,"tdur":36,"tts":22282}, | |
{"pid":18981,"tid":1,"ts":5358359762,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":9,"tdur":9,"tts":22322}, | |
{"pid":18981,"tid":1,"ts":5358359774,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":7,"tdur":7,"tts":22334}, | |
{"pid":18981,"tid":1,"ts":5358359934,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc","src_func":"OnQueueHasIncomingImmediateWork"},"dur":21,"tdur":21,"tts":22357}, | |
{"pid":18981,"tid":1,"ts":5358359939,"ph":"X","cat" |
This file contains hidden or 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
[{"name":"https://daliborgogic.com/","entryType":"navigation","startTime":0,"duration":1149.9,"initiatorType":"navigation","nextHopProtocol":"h2","workerStart":0,"redirectStart":0,"redirectEnd":0,"fetchStart":0.45500000000000007,"domainLookupStart":1.6700000000000002,"domainLookupEnd":9.585,"connectStart":9.585,"connectEnd":98.83500000000001,"secureConnectionStart":41.370000000000005,"requestStart":99.17500000000001,"responseStart":147.8,"responseEnd":149.11,"transferSize":3286,"encodedBodySize":2948,"decodedBodySize":6782,"serverTiming":[],"unloadEventStart":0,"unloadEventEnd":0,"domInteractive":207.07,"domContentLoadedEventStart":919.33,"domContentLoadedEventEnd":919.3350000000002,"domComplete":1138.67,"loadEventStart":1138.695,"loadEventEnd":1149.9,"type":"navigate","redirectCount":0},{"name":"https://daliborgogic.com/css/main.css","entryType":"resource","startTime":160.83,"duration":36.630000000000024,"initiatorType":"link","nextHopProtocol":"h2","workerStart":0,"redirectStart":0,"redirectEnd":0,"fetchSta |
This file contains hidden or 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
# REPOSITORY TAG IMAGE ID CREATED SIZE | |
# uptime latest 77f4f1980edc 8 hours ago 623MB | |
FROM node:9.2.0-slim | |
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | |
ENV NODE_ENV production | |
# Install latest chrome dev package. | |
RUN apt-get update && apt-get install -y wget --no-install-recommends \ |
This file contains hidden or 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
# REPOSITORY TAG IMAGE ID CREATED SIZE | |
# up latest 32f4569db5bc 54 seconds ago 894MB | |
FROM node:9.2.0-slim | |
RUN apt-get update && apt-get install -yq \ | |
gconf-service \ | |
libasound2 \ | |
libatk1.0-0 \ | |
libc6 \ |
This file contains hidden or 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
export default ({ app }) => { | |
if (process.env.NODE_ENV !== 'production') return | |
const KEY = 'ga:user' | |
const UID = (localStorage[KEY] = localStorage[KEY] || Math.random() + '.' + Math.random()) | |
function encode(obj) { | |
let k | |
let str = 'https://www.google-analytics.com/collect?v=1' | |
for (k in obj) { |
This file contains hidden or 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
FROM mhart/alpine-node:base-9.2.0 | |
WORKDIR /app | |
COPY . /app | |
ENV HOST 0.0.0.0 | |
EXPOSE 3000 | |
CMD ["node_modules/.bin/nuxt", "start"] |
This file contains hidden or 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
<script> | |
import debug from 'debug' | |
const a = debug('worker:a') | |
const b = debug('worker:b') | |
export default { | |
mounted () { | |
if (process.env.NODE_ENV !== 'production') { | |
window.localStorage.debug = 'worker:*' |
This file contains hidden or 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
/** | |
* Check variable type | |
* @return {Boolean} | |
*/ | |
export const isType = (type, val) => !!(val.constructor && val.constructor.name.toLowerCase() === type.toLowerCase()) |
This file contains hidden or 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
<?php | |
function alfa_where( $where) { | |
$where = str_replace("meta_key = 'tabela_$", "meta_key LIKE 'tabela_%", $where); | |
return $where; | |
} | |
add_filter('posts_where', 'alfa_where'); | |
add_filter( 'rest_query_vars', function ($valid_vars) { | |
return array_merge($valid_vars, array(array( |