Skip to content

Instantly share code, notes, and snippets.

View cinnamondev's full-sized avatar

cinnamondev

View GitHub Profile
function output = plotPolynomialFit(ds_x, ds_y, N,confidence, resolution)
[output, error] = polyfit(ds_x,ds_y,N);
if confidence
range = linspace(0, max(ds_x), resolution)
[outputline, delta] = polyconf(output, range, error, 'predopt', 'curve')
plot(range, outputline, "-");
hold on
plot(range,outputline+delta,"r--",range,outputline-delta,"r--");
hold off
else
@cinnamondev
cinnamondev / plotLinearFit.m
Last active October 30, 2023 12:10
MATLAB Helper Function Linear Fit
% Plots a linear fit of a dataset. Multiple data sets can be chained together in an array.
% Pass `true` to confidence parameter to generate a 95% confidence interval for the data.
% Resolution parameter will generate confidence interval with a better resolution.
function output = plotScatterLinearFit(ds_x, ds_y, confidence, resolution)
range = linspace(0, max(ds_x), resolution)
[output, error] = polyfit(ds_x,ds_y,1);
if confidence
[outputline, delta] = polyconf(output, range, error, 'predopt', 'curve')
plot(range, outputline, "-");
hold on
@cinnamondev
cinnamondev / FancyFetch.ps1
Last active May 29, 2023 03:28
Fancy-Fetch is a powershell script for some fancy fetching of modules. (install local & fetch local). Usage: Fancy-Fetch foo,bar,baz -InstallDir "./blah" -Provider "PSGallery"
function Fancy-Fetch {
param (
[string[]]$Modules,
[string]$InstallDir = './.ps-modules/',
[string]$Provider = 'PSGallery'
)
if (!(Test-Path $InstallDir)) {New-Item $InstallDir -ItemType Directory}
$Modules | Foreach-Object {
# Pull powershell-yaml if not installed
$mod_installed = (Get-Module -ListAvailable -Name $_)
@cinnamondev
cinnamondev / Oneplus 7 Pro 5G ROM Flashing.md
Last active March 9, 2023 01:35
GM1920 FLASHING DO NOT USE - UNFINISHED. PLEASE SEE TGRAM CHAT FOR ACTUAL PROCESS.

Oneplus 7 Pro 5G Resource List (EE5G, UK)

UNFINISHED, DO NOT USE.

A set of resources because telegram is annoying and sooner or later my install will probably break, and thats probably why you're here (or you're trying to install the ROM)

Preparation

BEFORE YOU START!

YOU NEED TO BACKUP NOW. What we are about to do is going to ERASE everything, not just settings or apps. The bootloader will also be re-locked temporarily. Please go ahead and move copies of your hot takes somewhere else before continuing!

@cinnamondev
cinnamondev / Additional resources
Created May 2, 2022 12:52
Eduqas (A-level) Computer Science WikiBooks Drafts & Additional resources. Focus on 2022 Advance Information.
https://www.youtube.com/channel/UCoHsD3Le9ppk4jgNyw51hLA
Channel going over WJEC A-Level Comp Sci (Welsh specific?)
https://www.youtube.com/watch?v=6bKeE1A5-LY&list=PL04uZ7242_M5PQnqp-pLNYF-lVR8gGy6u
MrBrownCS Component 1
https://www.youtube.com/watch?v=SbqXqQ-2ixs&list=PL04uZ7242_M6KzarBCtqtHAYyc7l6XDj3
MrBrownCS Component 2
https://en.wikibooks.org/wiki/A-level_Computing/WJEC_(Eduqas)
@cinnamondev
cinnamondev / docker-compose.yml
Last active November 2, 2022 18:53
Raspberry Pi Docker Compose full. Run `sudo docker-compose up -d`. Creates all docker networks and deploys all containers
version: "3.6"
# docker-compose.yml
# Docker setup for RPI4 services.
# Revision date 02.11.22
services:
portainer:
container_name: Portainer
restart: unless-stopped
image: portainer/portainer-ce