Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Upcoming availability for work.

Ron Evans deadprogram

💭
Upcoming availability for work.
View GitHub Profile
@aykevl
aykevl / sizecheck.sh
Last active December 4, 2021 13:49
Size comparison for TinyGo
#!/bin/sh
# Note: use this script like so:
# git checkout dev
# ./sizecheck.sh > size0.txt
# git checkout some-feature-branch
# ./sizecheck.sh > size1.txt
# sizediff size0.txt size1.txt
for t in testdata/*.go; do echo host $t; tinygo build -o test.elf -size=short -no-debug $t; md5sum test.elf; done
@yzl
yzl / TechAndEthicsReadingCollection.md
Last active October 5, 2020 22:13
tech and ethics reading collection

Tech and ethics reading collection

A list of books, essays, papers, blog posts, tweets, etc. on tech and ethics that I have either read and found useful or plan to read because I think they might be useful. I’m not especially interested in ethics that doesn’t take power or structure into account, so most of the standard texts one would read in a course on ethics aren’t represented on my list.

(My) starting point

Not strictly about either ethics or tech, but Claire Dederer’s What Do We Do With the Art of Monstrous Men? verbalizes something that is wound up in how I think about ethics, and what I hear when people talk about ethics:

This, I think, is what happens to so many of us when we consider the work of the monster geniuses—we tell ourselves we’re having ethical thoughts when really what we’re having is moral feelings.

Ideal theory

Dr. Robin James recommends Charles Mills’ [Ideal Theory as I

package main
import (
"fmt"
"image"
"image/color"
"io"
"os/exec"
"strconv"
"time"
@nikolaiianchuk
nikolaiianchuk / main.go
Last active January 10, 2023 07:43
Fixed memory leaking
package main
import (
"fmt"
"io/ioutil"
"net/http"
"runtime"
"time"
"gocv.io/x/gocv"
@ogero
ogero / OPENCV341_Android_compile.MD
Last active January 12, 2022 05:33
This process explains how to compile shared libs of opencv and contrib modules from sources for Android ABI `abi-armeabi-v7a`

Compilation of OpenCV & contrib modules from sources for Android

This process explains how to compile shared libs of opencv and contrib modules from sources for Android ABI abi-armeabi-v7a.

##Requirements

  • Sources for opencv-3.4.1
  • Sources for opencv_contrib-3.4.1
  • CMake 3.11.3
  • mingw-w64 x86_64-7.3.0-posix-seh-rt_v5-rev0
@microlinux
microlinux / tello.py
Last active February 14, 2021 02:42
Python interface for the Ryze Tello drone
"""3/21/2018 DEVELOPMENT HAS MOVED TO https://github.com/microlinux/tello"""
"""License.
Copyright 2018 Todd Mueller <firstnamelastname@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@hdoverobinson
hdoverobinson / ubxconfig.sh
Last active February 1, 2024 12:48
Configure u-blox GPS/GNSS modules with Bash
#!/bin/bash
###AUTHOR###
#Harry Dove-Robinson 5/8/2017
#harry@doverobinson.me
#https://gist.github.com/hdoverobinson
#https://github.com/hdoverobinson
###USAGE###
#This is a script used to configure u-blox GPS/GNSS modules from a text file generated by u-center.
@rahit
rahit / edges.py
Last active December 23, 2023 02:17
Canny, Prewitt and Sobel Edge detection using opencv
"""
edges.py: Canny, Prewitt and Sobel Edge detection using opencv
"""
__author__ = "K.M. Tahsin Hassan Rahit"
__email__ = "tahsin.rahit@gmail.com"
import cv2
import numpy as np
img = cv2.imread('messi5.jpg')

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

@arkival
arkival / intel-edison-cmdline.md
Last active March 21, 2018 00:31
C/C++ cross compilation from the command line for the Intel Edison

C/C++ cross compilation from the command line for the Intel Edison

It is not necessary to use the Eclipse environment in order to compile code for the Intel Edison. Command line compilation is possible on all platforms and is relatively straightforward. For linux and OS/X the simplest method is to download the SDK for the respective platform and setup as described below. Although Intel lists SDKs for both 32 and 64 bit Windows, I find it simpler to setup command line compilation from the integrated IOT platform installation.

All three platforms use the GNU compiler tools (gcc, g++, and friends) and the main differences really come down to differences in the command shell usage. Consequently, the procedures have the following common elements.

  1. Install the cross compilation tool chain and library file-system.
  2. Setup the path so that the operating system can find the compilers and other utilities.
  3. Setup environment variables to simplify the command line and tell the compilers where to find librari