Skip to content

Instantly share code, notes, and snippets.

#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
import sys,os,fileinput
def main(argv):
for line in fileinput.input():
bytes = line.lstrip(".byte ").rstrip('\n').split(',')
print(".byte ", end="")
// Copyright (C) 2019, Dan Ravensloft
// SPDX-License-Identifier: GPL-3.0-or-later
library(74series) {
// 7400 quad 2-input NAND gate
cell(7400_4xNAND2) {
area: 3;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A*B)'"; }
}
@bd2357
bd2357 / CeedlingWinNotes.txt
Last active April 30, 2023 19:07
Ceedling on Windows notes
Using Ceedling on Windows is a bit more involved than using it in a Linux
environment. It requires Ruby which is not often installed on windows machines,
and while Ceedling can be configures to run with most C compilers, out of the
box it tries to use GCC which is also not generally available on windows.
Now if you are running Windows 10 professional, you can install the bash shell
and things get easier but lets say you are stuck with Windows Home or Windows 7
and you want to do some quick and dirty test driven C coding with simple Mocks,
what is the best way to proceed?
Well it turns out that installing Ruby via the RubyInstaller for Windows
@hexagon5un
hexagon5un / gcodesender.py
Created April 15, 2019 14:54
gcodesender.py with "improved" defaults
#!/usr/bin/python
"""\
Simple g-code streaming script
https://github.com/bborncr/gcodesender.py/blob/master/gcodesender.py
"""
import serial
import time
import argparse
@AdaRoseCannon
AdaRoseCannon / HTMLElementPlus.js
Last active March 3, 2023 11:33
HTML Element Plus for Web Components
'use strict';
class HTMLElementPlus extends HTMLElement {
static defaultAttributeValue() {
/* the name of the attribute is parsed in as a parameter */
return;
}
static parseAttributeValue(name, value) {
@EntranceJew
EntranceJew / Get-TweetVid.ps1
Created May 17, 2017 20:33
take a twitter m3u8 link and download it properly
# take a twitter m3u8 link and download it properly
function Get-TweetVid {
param( [string]$Uri, [string]$OutDir )
$out_file = (Split-Path $Uri -Leaf).Replace(".m3u8", ".mp4")
$out_path = Join-Path $OutDir $out_file
if( -Not (Test-Path $out_path) ){
mkdir -Path $out_path
}
ffmpeg -i $Uri -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $out_path
}
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).

@pwuertz
pwuertz / kicad_picknplace_assistant.py
Last active November 27, 2023 07:04
KiCad PCB pick and place assistant
Moved to:
https://github.com/pwuertz/kicad_picknplace_assistant
@nedos
nedos / read_saleae.py
Last active April 6, 2018 15:44
This script parses a saleae csv export to generate a verilog simulation file (in picoseconds)
#!/usr/bin/python
import sys
import csv
def print_usage():
print "Usage: {} <csv_file>".format(sys.argv[0])
if len(sys.argv) != 2:
print "Not enough arguments"
print_usage()
@bertrandmartel
bertrandmartel / scantest.cpp
Last active February 22, 2024 14:03
Bluez BLE scanning example (port of https://github.com/carsonmcdonald/bluez-experiments in C++)
// g++ scantest.cpp -lbluetooth
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <iostream>
#include <signal.h>
#include <bluetooth/bluetooth.h>