How do I combine multiple OpenAPI 3 specification files together?

I wrote a quick tool to do this recently. I call it openapi-merge. There is a library and an associated CLI tool: https://www.npmjs.com/package/openapi-merge https://www.npmjs.com/package/openapi-merge-cli In order to use the CLI tool you just write a configuration file and then run npx openapi-merge-cli. The configuration file is fairly simple and would look something like this: { … Read more

MediaElementAudioSource outputs zeroes due to CORS access restrictions

In my response I will assume the following setup: Your stream URL is http://stream.radio.com:8000/mount (or http://stream.radio.com:8000/;stream/1 for Shoutcast) Your paget URL where you place your HTML/JS code URL is http://radio.com/player To get this working you need: Set the “Access-Control-Allow-Origin” header of your stream to your domain or * In javascript, set audio tag crossOrigin property … Read more

Spotify Apps API: any more documentation?

As others have said, it WAS possible to browse the source and view a sample “API” application, but neither of these are available anymore. For this reason, I have put together a kitchen sink application, which demonstrates how to perform much of the basic functionality. It may come in handy to anyone getting started: https://github.com/ptrwtts/kitchensink … Read more

How to call the Magento API from VB.NET

Function getHTTPStream() As String Dim myh As HttpWebRequest = _ HttpWebRequest.Create(“http://yourmagentoweb/soap/api/?wsdl”) myh.Timeout = 30000 myh.UserAgent = “Test” Dim myR As HttpWebResponse = myh.GetResponse() Dim myEnc As Encoding = Encoding.GetEncoding(1252) Dim mySr As StreamReader = New StreamReader(myR.GetResponseStream(), myEnc) Return mySr.ReadToEnd() End Function That code needs tweaking obviously- i have not got time to prettify this stuff … Read more

get releases empty in github api

From the documentation: This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the Repository Tags API. GitHub’s UI is confusing, but this repository doesn’t actually have any releases, which are a GitHub-specific concept. The “releases” … Read more

Read func interp of a z3 array from the z3 model

The representation for array models is indeed a bit confusing. The meaning of (define-fun some_array_1 () (Array Int Int) (_ as-array k!0)) is that the model for array some_array_1 is the function k!0 which is to be interpreted as an array (signified by the call to as-array. The latter is a parametric function, which has … Read more

Getting historical data from Twitter [closed]

Twitter notoriously does not make “available” tweets older than three weeks. In some cases you can only get one week. You’re better off storing tweets for the next three months. Many rightly doubt if they’re even persisted by Twitter. Are you looking for just any tweets? If so, check out the Streaming API’s status/sample method. … Read more

Drawing in a Win32 Console on C++?

Yes, it is possible. Get the HWND of the console window using GetConsoleWindow and then draw in it. #define _WIN32_WINNT 0x601 #include <windows.h> #include <stdio.h> int main() { // Get window handle to console, and device context HWND console_handle = GetConsoleWindow(); HDC device_context = GetDC(console_handle); //Here’s a 5 pixels wide RED line [from initial 0,0] … Read more

Fetching multiple urls with aiohttp in python

Working example: import asyncio import aiohttp import ssl url_list = [‘https://api.pushshift.io/reddit/search/comment/?q=Nestle&size=30&after=1530396000&before=1530436000’, ‘https://api.pushshift.io/reddit/search/comment/?q=Nestle&size=30&after=1530436000&before=1530476000’] async def fetch(session, url): async with session.get(url, ssl=ssl.SSLContext()) as response: return await response.json() async def fetch_all(urls, loop): async with aiohttp.ClientSession(loop=loop) as session: results = await asyncio.gather(*[fetch(session, url) for url in urls], return_exceptions=True) return results if __name__ == ‘__main__’: loop = asyncio.get_event_loop() urls = … Read more