Skip to content

Instantly share code, notes, and snippets.

@Darkside73
Darkside73 / DateRangePicker.vue
Last active February 26, 2020 12:31
Vuetify DateRangePicker (obsolete since Vuetify has built-in range picker)
<template>
<v-date-picker
class="date-range-picker" :value="value" @input="onInput"
color="light-blue" event-color="light-blue lighten-4 date-in-range" :events="selectedRange"
:allowed-dates="allowedDates" no-title multiple
>
<slot></slot>
</v-date-picker>
</template>
function map (arr, func) {
return Promise.resolve().then(function () {
return arr.map(function (el) { return func(el) })
}).all()
}
function mapSeries (arr, func) {
let currentPromise = Promise.resolve()
let promises = arr.map(function (el) {
return currentPromise = currentPromise.then(function () {
@gido
gido / macosx-install-php-oracle-oci8.md
Last active June 1, 2021 08:49
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@jayjanssen
jayjanssen / gist:4039319
Created November 8, 2012 15:02
sysctl tuning for HAproxy
net.core.somaxconn = 32768
net.ipv4.conf.all.send_redirects = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 262144
net.ipv4.tcp_mem = 200000    280000    300000
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@neuronix
neuronix / gist:2016071
Created March 11, 2012 11:20
Rendering dynamic parameters in a dust.js helper
// Handy function to render dynamic parameters in a dust.js helper
function renderParameter(name, chunk, context, bodies, params) {
if (params && params[name]) {
if (typeof params[name] === "function") {
var output = "";
chunk.tap(function (data) {
output += data;
return "";
}).render(params[name], context).untap();
return output;
@tbranyen
tbranyen / backbone_pushstate_router.js
Last active February 25, 2024 21:38
hijack links for pushState in Backbone
// All navigation that is relative should be passed through the navigate
// method, to be processed by the router. If the link has a `data-bypass`
// attribute, bypass the delegation completely.
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
// Get the absolute anchor href.
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
// Get the absolute root.
var root = location.protocol + "//" + location.host + Application.root;
// Ensure the root is part of the anchor href, meaning it's relative.