Skip to content

Instantly share code, notes, and snippets.

View amcolash's full-sized avatar

Andrew McOlash amcolash

View GitHub Profile
@sxiii
sxiii / readme.md
Created March 4, 2021 19:40
How to launch games via Proton from CLI (useful for debug)

How to launch games via Proton from CLI (useful for debug)

In just 2 steps

First. Run this:

export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata

Second. Now in the same terminal, run your game (this example: Raft)

~/.local/share/Steam/steamapps/common/Proton\ 5.13/proton run ~/.local/share/Steam/steamapps/common/Raft/Raft.exe

@CelliesProjects
CelliesProjects / structToFile.ino
Last active September 1, 2023 18:04
Read and write a c++ struct to a file. Arduino IDE. ESP32.
/*
* EXAMPLE READING AND WRITING A C++ STRUCT TO A FILE
*/
#include <FS.h>
#include <FFat.h>
const char *fileName = "/somefile.txt";
struct aStruct {
char someString[11];
// npm install --save scrollreveal or install like you're used to doing it.
// It doesn't work well if there are multiple instances of ScrollReveal,
// so we have to create a module returning an instance:
// file ScrollReveal.js:
import ScrollReveal from 'scrollreveal'
export default ScrollReveal()
// Then in a component:
import React from 'react'
import sr from './ScrollReveal'
@netom
netom / spectrum.py
Last active July 24, 2023 21:51
Simple spectrum analyzer in python using pyaudio and matplotlib
#!/usr/bin/env python
# -*- charset utf8 -*-
import pyaudio
import numpy
import math
import matplotlib.pyplot as plt
import matplotlib.animation
RATE = 44100
#include <pic16f877a.h>
#include "uart.h"
#include "eeprom.h"
/* start the main program */
int main()
{
unsigned char eeprom_address = 0, write_char, read_char;
unsigned char EEPROM_ReadByte(unsigned char eepromAddress)
{
while(RD || WR); // check the WR&RD bit to see if a RD/WR is in progress
EEADR=eepromAddress; // Write the address to EEADR.
RD = 1; // Set the RD bit to trigger the eeprom read operation.
return(EEDATA); // Return the data read form eeprom.
}
void EEPROM_WriteByte(unsigned char eepromAddress, unsigned char eepromData)
{
unsigned char gie_Status;
while(WR); // check the WR bit to see if a previous Write operation is in progress
EEADR=eepromAddress; // Write the address to EEADR.
EEDATA=eepromData; // load the 8-bit data value to be written in the EEDATA register.
WREN=1; // Set the WREN bit to enable eeprom operation.
gie_Status = GIE; // Copy the current Interrupt state
GIE = 0; // Disable the interrupts