Skip to content

Instantly share code, notes, and snippets.

View newdigate's full-sized avatar

Nic Newdigate newdigate

View GitHub Profile
# Source: https://gist.github.com/8d941690a087b0de0e2731a52cfb1f51
###############################################################
# Building Event-Driven Microservices In Kubernetes With Dapr #
# https://youtu.be/-4sHUvfk2Eg #
###############################################################
# Additional Info:
# - https://dapr.io
# - What is microservices architecture?: https://youtu.be/F-37_gV2tMs
#include <Audio.h>
#include <ST7735_t3.h> // Hardware-specific library
#include <ResponsiveAnalogRead.h>
#include "teensy_eurorack.h"
#include "output_spi.h"
#include "ScopeView.h"
ST7735_t3 TFT = ST7735_t3(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
@DurandA
DurandA / Makefile
Created August 6, 2019 12:39
NextPNR makefile for TinyFPGA BX
# Makefile borrowed from https://github.com/cliffordwolf/icestorm/blob/master/examples/icestick/Makefile
#
# The following license is from the icestorm project and specifically applies to this file only:
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@yorikvanhavre
yorikvanhavre / io_import_fcstd.py
Last active July 17, 2023 20:43
Blender FreeCAD importer stub
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@lyoshenka
lyoshenka / coding_maxims.md
Last active August 23, 2023 21:18
Keep this in mind
@newdigate
newdigate / gist:b2f2d3c96daf0ab26260
Last active August 29, 2015 14:21
SQLServer Dynamic Revision Table DDL Generator
CREATE FUNCTION dbo.genRevTableColumnsDDL( @TableName AS VARCHAR(40) ) RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql += CASE
WHEN column_ordinal = 1 AND UPPER(name) = 'ID' THEN
CHAR(9) + '[ID]'+ CHAR(9) + 'BIGINT' + CHAR(9) + 'NOT NULL PRIMARY KEY IDENTITY,' + CHAR(13) + CHAR(10) +
CHAR(9) + '['+@TableName+'ID]'+ CHAR(9) + 'BIGINT' + CHAR(9) + 'NOT NULL,' + CHAR(13) + CHAR(10)
ELSE
CHAR(9) + '[' + name + '] ' + system_type_name + ' NULL,'+ CHAR(13) + CHAR(10)
@domenic
domenic / v8-versions.md
Last active December 11, 2020 01:45
V8 versions for embedders

Embedders of V8 should generally use the head of the branch corresponding to the minor version of V8 that ships in Chrome.

Finding the minor version of V8 corresponding to the latest stable Chrome

To find out what version this is,

  1. Go to https://omahaproxy.appspot.com/
  2. Find the latest stable Chrome version in the table
  3. Enter it into the "Translate a Chrome verison to a V8 version" box below the table.
  4. Ignore the last two parts.
@staltz
staltz / introrx.md
Last active July 26, 2024 04:24
The introduction to Reactive Programming you've been missing
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@dergachev
dergachev / squid-deb-proxy_on_docker.md
Last active May 25, 2023 03:55
Caching debian package installation with docker

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"