Skip to content

Instantly share code, notes, and snippets.

View LukeGary462's full-sized avatar

Luke Gary LukeGary462

  • Rye Effects Research
  • Philadelphia, PA
View GitHub Profile
@LukeGary462
LukeGary462 / inheritance_c11.c
Created November 23, 2023 14:10
C11 structure inheritance patterns
/**
* @file: inheritance.c
* @name: Luke Gary
* @company: <company>
* @date: 2023/11/22
********************************************************************************
* @copyright
* Humanity
********************************************************************************
* @brief: practice for oop inheritance in c
@LukeGary462
LukeGary462 / machine-config.bat
Created July 18, 2023 20:32
windows programs setup
:: power shell only
:: chocolatey
Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
:: scoop
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
:: general programs
@LukeGary462
LukeGary462 / confluence_pdf_export.css
Created June 15, 2023 04:02
Confluence PDF Export, Single Column Page Layout
@page {
size: 210mm 297mm; /* A4-sized pages in portrait orientation; default is US letter */
margin-top: 2.54cm;
margin-bottom: 2.54cm;
margin-left: 1.27cm;
margin-right: 1.27cm;
}
body,p,li,td,table,tr,.bodytext,.stepfield {
font-size: 15px;
@LukeGary462
LukeGary462 / trigraph_bitmasking.c
Created March 7, 2023 21:36
c trigraph support
#include <stdio.h>
#include <stdint.h>
/** This is fun...
* Trigraph Replaces
*
* ??( [
* ??) ]
* ??< {
* ??> }
@LukeGary462
LukeGary462 / foreach_test.c
Created March 7, 2023 21:23
C foreach macro implementation
// test
// https://paiza.io/projects/gckklFp-m9gy5nT3pGsFKw
// stack overflow source
// https://stackoverflow.com/questions/400951/does-c-have-a-foreach-loop-construct
#include <stdio.h>
#include <stdint.h>
#define COUNTOF(x) (sizeof(x) / sizeof(x[0]))
@LukeGary462
LukeGary462 / test_msox3032T.py
Created November 9, 2022 17:52
MSO-X 3032T test code using instrument.py
"""
test file for mso-x 3032T oscilloscope
"""
from instruments.instrument import Instrument
from instruments.oscilloscope import *
from time import sleep
import scipy.signal as sig
import scipy.fft as fft
@LukeGary462
LukeGary462 / oscilloscope.py
Created November 9, 2022 17:52
oscilloscope instrument python using instrument.py some things are a little broken...
from instruments.instrument import Instrument
from pyvisa import (VisaIOError, InvalidSession, VisaIOWarning, log_to_screen, ResourceManager)
import pprint as pp
import numpy as np
class OscilloscopeModels:
"""
This class describes oscilloscope models.
"""
@LukeGary462
LukeGary462 / instrument.py
Created November 9, 2022 17:50
VISA Instrument Python
"""
Generic VISA Intrument interface
"""
import time
from datetime import datetime
from typing import List
import pprint as pp
from pyvisa import (VisaIOError, InvalidSession, VisaIOWarning, log_to_screen, ResourceManager)
@LukeGary462
LukeGary462 / test.c
Created October 25, 2022 02:10
normalize adc codes for general audio processing. quick 'n dirty
// https://paiza.io/projects/OrgoRimpHHbdu59tfAsmoQ
#include <stdint.h>
#include <stdio.h>
#define ADC_MAX_CODE (0x0FFFu)
static float convert_to_normalized(uint16_t sample);
static float convert_to_normalized(uint16_t sample)
{
return (((2.0f)/(float)ADC_MAX_CODE) * (float)sample) - 1.0f;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.