Skip to content

Instantly share code, notes, and snippets.

View midibyte's full-sized avatar
🎯
Focusing

midibyte midibyte

🎯
Focusing
  • Florida
View GitHub Profile
@JonnieCache
JonnieCache / spacewar.lst
Created December 11, 2012 12:11
Spacewar PDP1 Source Code
-/macro fio-dec system, june 1963
007652 640500 szm=sza sma-szf
007652 650500 spq=szm i
007652 761200 clc=cma+cla-opr
- define senseswitch A
- repeat 3, A=A+A
- szs A
- term
- define init A,B
- law B
@shmup
shmup / spacewar.lst
Created December 11, 2012 13:17 — forked from JonnieCache/spacewar.lst
Spacewar PDP1 Source Code
-/macro fio-dec system, june 1963
007652 640500 szm=sza sma-szf
007652 650500 spq=szm i
007652 761200 clc=cma+cla-opr
- define senseswitch A
- repeat 3, A=A+A
- szs A
- term
- define init A,B
- law B
@rzhukov
rzhukov / rgb_hsi.h
Created February 21, 2014 06:05
RGB to HSI and HSI to RGB color space conversion
inline void HSI2RGB(double h, double s, double i, double* r, double* g, double* b)
{
double x = i * (1 - s);
if(h < 2 * M_PI / 3)
{
double y = i * (1 + (s * cos(h)) / (cos(M_PI / 3 - h)));
double z = 3 * i - (x + y);
*b = x; *r = y; *g = z;
}
else if(h < 4 * M_PI / 3)
@fairlight1337
fairlight1337 / hsvrgb-cpp
Created June 2, 2014 07:39
Simple RGB/HSV conversion in C++
// Copyright (c) 2014, Jan Winkler <winkler@cs.uni-bremen.de>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
@bmccormack
bmccormack / movingAvg.c
Created March 31, 2015 01:05
Moving average example in C
#include <stdio.h>
int movingAvg(int *ptrArrNumbers, long *ptrSum, int pos, int len, int nextNum)
{
//Subtract the oldest number from the prev sum, add the new number
*ptrSum = *ptrSum - ptrArrNumbers[pos] + nextNum;
//Assign the nextNum to the position in the array
ptrArrNumbers[pos] = nextNum;
//return the average
return *ptrSum / len;
@CyberPunkCodes
CyberPunkCodes / killadobe.sh
Last active November 21, 2022 16:41
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
@theychx
theychx / ytdl_totalsize.py
Last active October 2, 2023 08:31
Script that uses youtube-dl to calculate total size of all videos in a playlist (also works with single videos). Now at this repo: https://github.com/theychx/totalsize
#! /usr/bin/env python3
import math
import sys
import youtube_dl
BEST_FORMAT = "bestvideo+bestaudio/best"
@mattst
mattst / Test_CRF_Presets_For_Libx264_Encodes
Created November 9, 2018 17:18
Script to test encode speeds and file sizes for libx264 encodes with a range of CRF values and presets
#!/bin/bash
infile="TestClipTwoMin.mp4"
datafile="TestClipTwoMinData.csv"
crfs=("18" "19" "20" "21" "22" "23" "24" "25" "26" "27")
presets=("ultrafast" "superfast" "veryfast" "faster" "fast" "medium" "slow" "slower" "veryslow")
echo 'CRF,Preset,Time (Secs),Size (MB)' >> "$datafile"
@dataslayermedia
dataslayermedia / alpr-nodejs-raspberrypi.js
Created December 3, 2018 22:59
ALPR License Plate Detection for Raspberry PI written in Node.js
const PiCamera = require('pi-camera');
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
setInterval(function() {
var path = './' + getRandomInt(500) + '.jpg';