Skip to content

Instantly share code, notes, and snippets.

@mkormendy
mkormendy / setup-unifi-macos.sh
Created Mar 1, 2021
UniFi Network Controller Setup for MacOS with Homebrew
View setup-unifi-macos.sh
#!/bin/sh
brew tap homebrew/cask-drivers
brew install --cask homebrew/cask-versions/adoptopenjdk8
brew install --cask ubiquiti-unifi-controller
@guillermo
guillermo / svg2pdf.bash
Created Dec 1, 2020 — forked from s417-lama/svg2pdf.bash
Reliable way to convert an SVG file to a PDF file using headless Chrome
View svg2pdf.bash
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
@s417-lama
s417-lama / svg2pdf.bash
Created Apr 29, 2020
Reliable way to convert an SVG file to a PDF file using headless Chrome
View svg2pdf.bash
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
@nraynaud
nraynaud / dxf_color.cps
Last active Apr 27, 2019
A Fusion 360 DXF post processor whose output uses one color per operation, useful for users of Lasercut 5.3. See: https://www.reddit.com/r/ChineseLaserCutters/comments/b793x5/i_improved_the_dxf_post_processor_for_fusion_360/
View dxf_color.cps
/**
Copyright (C) 2015-2018 by Autodesk, Inc.
All rights reserved.
Altered by nraynaud
*/
description = "Color AutoCAD DXF";
vendor = "Autodesk/nraynaud";
vendorUrl = "http://www.autodesk.com";
@exussum12
exussum12 / generate.sh
Created Jul 3, 2018
FlippingBook to PDF
View generate.sh
#!/bin/bash
mkdir -p out
for i in $(seq 1 120); do
page=`printf "%04d" $i`;
wget "https://www.website/files/assets/common/page-html5-substrates/page${page}_4.jpg"
wget "https://www.website/files/assets/common/page-vectorlayers/${page}.svg"
convert -flatten -geometry 1149x2550 -fuzz 10% -transparent white -density 400 page${page}_4.jpg $page.svg out/$page.pdf
@jkjung-avt
jkjung-avt / openalpr_camera.py
Last active Oct 11, 2021
Real-time license plate recognition with 'openalpr' using a video file as input. Please check out my "Building and Testing 'openalpr' on Jetson TX2" post for more information: https://jkjung-avt.github.io/openalpr-on-tx2/
View openalpr_camera.py
# test_camera.py
#
# Open an RTSP stream and feed image frames to 'openalpr'
# for real-time license plate recognition.
import numpy as np
import cv2
from openalpr import Alpr
@tylerlindell
tylerlindell / reduce_faces.py
Last active Oct 21, 2021
script for reducing faces programmatically with Meshlab's api
View reduce_faces.py
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@martinvirtel
martinvirtel / krpano-to-marzipano.config
Last active Aug 4, 2021
Generate tile files for marzipano.net panorama viewer with krpanotools from krpano.com
View krpano-to-marzipano.config
# Generate tile files that can be used with https://www.marzipano.net
# This is a config file for https://krpano.com/tools/kmakemultires/config/ -
flash=false
html=false
xml=false
panotype=autodetect
tilesize=512
View upload_to_octoprint.sh
#!/bin/bash
{
filename="$1"
user="pi"
host="octopi.local"
destination="~/.octoprint/uploads"
bandwidth_limit="1000" # prevents stalling on large files; kbit/s
View PROGMEM.md

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR