Skip to content

Instantly share code, notes, and snippets.

View anthonyec's full-sized avatar
🐢
eat the food and live

Anthony Cossins anthonyec

🐢
eat the food and live
View GitHub Profile
@belzecue
belzecue / gamepad_debugger.gd
Last active January 16, 2024 02:26 — forked from anthonyec/gamepad_debugger.gd
Godot gamepad input visualisation for debugging (GDScript 2)
# Godot 3.x version of a Godot 4 script written by anthonyec at:
# https://gist.github.com/anthonyec/5342fce79b2b7b22ada748df0ad7f7c0
# This Godot 3.x version available at:
# https://gist.github.com/belzecue/025d8829f69dead512e58f44e990ce30/edit
# Attach script to a Control node.
tool
extends Control
export var device: int = 0
@siracusa
siracusa / SwiftUIIfModifier.swift
Created July 11, 2022 14:56
SwiftUI .if modifier
extension View {
@ViewBuilder
func `if`<Content: View>(_ conditional: Bool, @ViewBuilder content: (Self) -> Content) -> some View {
if conditional {
content(self)
}
else {
self
}
}
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@jarmitage
jarmitage / avril.tidal
Created April 14, 2020 20:37
Avril 14th
-- happy avril 14th :)))))))))))))))))))))))))))))))))))))))
do
let bars = 4
key = "8"
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]"
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]"
d1 $ slow bars
$ stack [
n (righthand + key + "<24 36>/2"),
@paolocarrasco
paolocarrasco / README.md
Last active July 23, 2024 14:37
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@woudsma
woudsma / dokku-kirby-autogit.md
Last active May 15, 2021 17:32
Dokku + Kirby + AutoGit

TL;DR

  • Configure Kirby for Dokku
  • Install deployment-keys and host keys Dokku plugins
  • Set up staging and production environments
  • Clone project repository into apps persistent storage folders
  • Mount desired folders including .git folder to apps
  • Add GIT_DIR and GIT_WORK_TREE environment variables to containers
  • Deploy to Dokku
@ahem
ahem / loadimage.js
Created October 18, 2016 12:59
Load and decode images with webworker
/* global createImageBitmap */
function loadImageWithImageTag(src) {
return new Promise((resolve, reject) => {
const img = new Image;
img.crossOrigin = '';
img.src = src;
img.onload = () => { resolve(img); };
img.onerror = () => { reject(img); };
});
@gkhays
gkhays / DrawSineWave.html
Last active July 17, 2024 23:13
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
@rtfpessoa
rtfpessoa / lazy-load-nvm.sh
Created August 26, 2016 11:42
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
@thaerlabs
thaerlabs / .babelrc
Last active November 16, 2016 17:36
React hello world is not hard
{
"presets": ["es2015", "react"]
}