Skip to content

Instantly share code, notes, and snippets.

Robert Kummer rokde

Block or report user

Report or block rokde

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
@rokde
rokde / DatePicker.vue
Last active Mar 13, 2018
Explanation of using v-model with two-way sync for input form controls within your own custom components.
View DatePicker.vue
<template>
<div class="date-picker">
Month: <input type="number" ref="monthPicker" :value="value.month" @input="updateDate()"/>
Year: <input type="number" ref="yearPicker" :value="value.year" @input="updateDate()"/>
</div>
</template>
<script>
export default {
props: ['value'],
View comparing-time-periods-or-date-ranges-in-sql.md

Comparing Time Periods or Date Ranges with SQL

TL;DR

SELECT * FROM periods
WHERE range_start <= @check_period_end
  AND range_end >= @check_period_start

The opposite:

@rokde
rokde / SlowQueryListeningOnLaravel4
Created Feb 11, 2015
Logging slow queries in Laravel environments (e.g. /app/start/[environment].php)
View SlowQueryListeningOnLaravel4
/** @var \Illuminate\Log\Writer $log */
$log = App::make('log');
DB::listen(function ($sql, $bindings, $time) use ($log) {
if ( ! starts_with($sql, 'select'))
return;
// only log long running select statements
if ($time <= 1)
You can’t perform that action at this time.