Skip to content

Instantly share code, notes, and snippets.

View bison--'s full-sized avatar

bison bison--

View GitHub Profile
@aldavigdis
aldavigdis / falsehoods.md
Last active March 3, 2023 09:00
Falsehoods programmers belive about location data

Being inspired by Falsehoods Programmers Believe About Names, I wrote down this list of falsehoods programmers belive about locations and addresses.

Using an external API

  • Information from the Google Maps API is always correct and up to date.
  • At least there is a single, correct location database that I can use.

Basic validation and formatting

  • Every location has an English name.
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@AnsisMalins
AnsisMalins / index.html
Last active June 4, 2021 07:04
Unity WebGL template that fills the viewport
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>%UNITY_WEB_NAME%</title>
<style>
body {
margin: 0;
}
@AnsisMalins
AnsisMalins / QueryWindow.cs
Last active November 1, 2019 21:44
LINQ Query Window for Unity
using Microsoft.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using UnityEditor;
@npearce
npearce / install-docker.md
Last active June 5, 2024 20:07
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@FlaShG
FlaShG / CanvasPositioningExtensions.cs
Last active May 8, 2024 09:33
A small Unity helper class to convert viewport, screen or world positions to canvas space.
using UnityEngine;
/// <summary>
/// Small helper class to convert viewport, screen or world positions to canvas space.
/// Only works with screen space canvases.
/// </summary>
/// <example>
/// <code>
/// objectOnCanvasRectTransform.anchoredPosition = specificCanvas.WorldToCanvasPoint(worldspaceTransform.position);
/// </code>
@ditzel
ditzel / MathParabola.cs
Last active February 19, 2024 02:07
A simple Math class to calculate a point in 2D or 3D space lying on a parabola. And a more complex parabola controller that you can put on an object.
using UnityEngine;
using System;
public class MathParabola
{
public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t)
{
Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
@ffyhlkain
ffyhlkain / ReferenceFinder.cs
Last active October 18, 2023 00:54
A reference finder for assets in a #Unity3d project.
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace FoundationEditor.Editor.ReferenceFinder
{
@GLMeece
GLMeece / latency_numbers.md
Last active May 22, 2024 15:57
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@tophermade
tophermade / SteamWorkshop.cs
Last active December 11, 2023 12:52
Unity script for accessing the Workshop with the steamworks.net C# wrapper
using UnityEngine;
using System.Collections.Generic;
using Steamworks;
/// <summary>
/// This class was created by Vitor Pêgas on 01/01/2017
/// From http://answers.unity3d.com/questions/1282772/steamworksnet-and-steam-workshop.html
/// Added here so it doesn't disappear
/// Requires https://steamworks.github.io/
/// </summary>