Skip to content

Instantly share code, notes, and snippets.

View linknum23's full-sized avatar

Lincoln Lorenz linknum23

  • MicroNova
  • United States
View GitHub Profile
@UnaNancyOwen
UnaNancyOwen / CMakeLists.txt
Last active October 26, 2024 16:16
CMakeLists for OpenCV
cmake_minimum_required( VERSION 3.6 )
# Create Project
project( solution )
add_executable( project main.cpp )
# Set StartUp Project
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
# Find Package
@samtherussell
samtherussell / api_ref.txt
Last active October 24, 2024 10:48
Logitech SqueezeServer JSONRPC API
Squeezebox API
--------------
This document outlines the JSON RPC interface with a squeezeserver to control and obtain information about squeezeboxes.
JSON : JavaScript Object Notation
RPC : Remote Procedure Call
Uses POST requests sent to:
http://<squeezeserver_address>:9000/jsonrpc.js
@vigneshjs
vigneshjs / app.py
Last active October 8, 2024 04:37
Adding multiple request body examples to swagger docs in fastAPI
"""
FastAPI uses pydantic models to validate the API request body and also generate the swagger documentation. Since the schema
generated by pydantic only comply to JSON schema specification and not to openAPI specification, swagger documentation
generated from pydantic models do not support adding multiple examples for a request body.
Ref: https://fastapi.tiangolo.com/tutorial/schema-extra-example/#technical-details
In the following code, I have extended fastAPI openAPI schema to include multiple request body examples.
"""
import json
@Arsenic-ATG
Arsenic-ATG / WorkReport.md
Last active December 1, 2023 20:19
GSoC 2021 : Extending gcc static analyzer to support virtual functions calls.

Overview

The project aims to make GCC's static analysis pass ( -fanalyzer option ) understand dynamic dispatch ( calls to virtual functions ) in C++.

This project will greatly benefit people who, like me, use static analysis pass to analyse their C++ programs for various problems at compile-time rather than spending a lot more time finding them at runtime, making the overall debugging process of any C++ project much faster and easier without using any additional tool except from the GCC compiler itself.

Status of Analyzer Before (GCC 11):

Although the static analyzer of GCC does it's job amazingly well for C code, it doesn't properly support C++ yet. Let's see this with an example where the analyzer triggers a false positive :-

@ogoldberg
ogoldberg / Google Calendar for Teams.gs
Last active September 26, 2024 19:29 — forked from mburtscher/Google Calendar for Teams.gs
Slack "Google Calendar for Teams" replacement
var webhookUrl = 'https://hooks.slack.com/services/XXXXXXXXXX/XXXXXXXXXX/XXXXXXXXXX'; // Webhook URL
var calendarId = '[email protected]'; // Id of the calendar
var slackChannel = '#team-calendar'; // Name of Slack channel to post updates to
var threshold = 30; // Seconds to look back after "onEventUpdated" event was received
var messageSingle = 'There is *1 event*';
var messageMultiple = 'There are *{events} events*';
var messageCreated = 'A *new event* has been created:';
function sendDailyEventsSummary() {
sendEventsSummary(1, "today")