Skip to content

Instantly share code, notes, and snippets.

View kynetiv's full-sized avatar

Miles Fink kynetiv

View GitHub Profile
@kynetiv
kynetiv / OWM-swagger-2.5.2.yaml
Created September 24, 2022 15:52
Open-Weather-Map Swagger 2.5.2
---
openapi: 3.0.1
info:
title: OpenWeatherMap API
description: 'Get current weather, daily forecast for 16 days, and 3-hourly forecast 5 days for your city. Helpful stats, graphics, and this day in history charts are available for your reference. Interactive maps show precipitation, clouds, pressure, wind around your location stations. Data is available in JSON, XML, or HTML format. **Note**: This sample Swagger file covers the `current` endpoint only from the OpenWeatherMap API. <br/><br/> **Note**: All parameters are optional, but you must select at least one parameter. Calling the API by city ID (using the `id` parameter) will provide the most precise location results.'
termsOfService: https://openweathermap.org/terms
contact:
name: OpenWeatherMap API
url: https://openweathermap.org/api
email: some_email@gmail.com
@kynetiv
kynetiv / TenantDatabaseCreating.php
Last active February 28, 2019 00:54
Laravel Multi-tenant event listener for Hyn\Tenancy\Events\Database\Creating event. Workaround for RDS and MySQL 5.6 (related: https://github.com/hyn/multi-tenant/issues/660)
<?php
namespace App\Listeners;
use Hyn\Tenancy\Database\Connection;
use Hyn\Tenancy\Events;
use Hyn\Tenancy\Events\Database\Creating;
use Hyn\Tenancy\Traits\DispatchesEvents;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
@kynetiv
kynetiv / homebrew.mxcl.elasticsearch24.plist
Last active December 28, 2016 17:52
Brew Elasticsearch 2.4.x Dots in fields name - /usr/local/opt/elasticsearch@2.4/homebrew.mxcl.elasticsearch@2.4.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>homebrew.mxcl.elasticsearch24</string>
<key>ProgramArguments</key>
<array>
@kynetiv
kynetiv / hexo-post-permalink-fix.js
Last active October 22, 2018 10:14
Hack for Hexo post permalink overrides
/**
* Fix post permalink not overriding config permalink in Hexo v3.2.2
* Add a `mypermalink: hello-example` to any post front-matter to override config.
* Place this script in your project/scripts directory (project/scripts/hexo-post-permalink-fix.js)
*/
hexo.extend.filter.register('post_permalink', function(data) {
if (typeof data.mypermalink != "undefined") {
// unregister default post_permalink filter that doesn't respect custom post permalink
hexo.extend.filter.unregister('post_permalink', require('hexo/lib/plugins/filter/post_permalink') );
// hacky way to bypass an error due to newly missing filter above