Skip to content

Instantly share code, notes, and snippets.

View RyAndrew's full-sized avatar
🎯
Focusing

Andrew Ry RyAndrew

🎯
Focusing
View GitHub Profile
@jwage
jwage / SplClassLoader.php
Last active August 16, 2024 17:36
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//Demo sketch
//This sketch will output distance into via the UART port
//port assignment
//change as may be necessary
const int trigger = 6;
const int echo = 7;
float distance;
@sphaero
sphaero / gstreamer-build.sh
Last active February 11, 2023 16:25
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
BRANCH="master"
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
RPI="1"
fi
[ -n "$1" ] && BRANCH=$1
@carcinocron
carcinocron / debugger pause beforeunload
Last active September 24, 2024 12:02
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@vasanthk
vasanthk / System Design.md
Last active November 14, 2024 11:31
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@albacoretuna
albacoretuna / nginx_config_beanstalk.yaml
Created February 13, 2017 15:23
Nginx configuration for aws beanstalk, enables gzip, sets up node proxy
# All nginx configurations can go here
files:
# This creates a file at the address below on the beanstalk instance
/etc/nginx/conf.d/proxy.conf:
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:8081;
@r3n33
r3n33 / gist:acaa8110c9c11b2a7d865e62ef29a320
Last active June 30, 2019 20:32
LetsRobot.tv Video Overlay

Letsrobot.tv / Run My Robot Overlay Guide

  • Both of these methods expect a PNG image with transparency to be the same size as your video feed ( 640x480 by default ). It is possible to blend images at different resolutions with alternate commands but beyond the scope of this document.

Static video overlay

  • Requires no modification to FFMPEG
  • Add overlayCommand and change the videoCommandLine in send_video.py:

staticOverlayCommand = '-f image2 -i /home/pi/runmyrobot/images/hud.png -filter_complex "[0:v]format=argb,geq=r=\'r(X,Y)\':g=\'g(X,Y)\':b=\'b(X,Y)\':a=\'0.7*alpha(X,Y)\'[overlay]; [1:v][overlay]overlay"'

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 15, 2024 12:45 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@weijuans-msft
weijuans-msft / FeaturesRemovedFromServerCoreContainer
Last active February 10, 2021 06:47
Features Removed from Windows Server Core Container base image starting with Insider Build 17074 (For Windows Server v1803 release)
Mar 12, 2018 update: due to issues found internally, we added back 2 features:
Printing-Client
Windows-Defender-Features
-------
In the recent blog we shared that we removed a number of features to further reduce the size of the Windows Server Core container base image.
https://techcommunity.microsoft.com/t5/containers/a-smaller-windows-server-core-container-with-better-application/ba-p/382412.
Below is that list of features we removed. Let us know if you have any concern or share your feedback with us how this has worked for you. Thanks.
@jkatz
jkatz / setup.sh
Last active September 9, 2023 03:00
Install PostgreSQL 10 & pgAdmin 4 with Docker
#!/bin/bash
mkdir postgres
cd postgres
docker volume create --driver local --name=pgvolume
docker volume create --driver local --name=pga4volume
docker network create --driver bridge pgnetwork