Skip to content

Instantly share code, notes, and snippets.

@roastchicken
roastchicken / ynab-sidebar-hide.user.js
Last active March 12, 2020 18:07
Greasemonkey script that adds a button to You Need a Budget which hides the sidebar
// ==UserScript==
// @name YNAB Hide Sidebar
// @namespace roastchicken
// @match https://app.youneedabudget.com/*
// @grant none
// @version 0.5
// @author roastchicken
// @homepageURL https://roastchicken.io
// @downloadURL https://gist.githubusercontent.com/roastchicken/c58a6671c733007ea32936c7db64ac37/raw/ynab-sidebar-hide.user.js
// @description Adds a button to hide the sidebar
const int numberSegments[ 10 ][ 8 ] =
{
{ 0, 1, 1, 1, 1, 1, 1, 0 }, // 0
{ 0, 0, 0, 1, 1, 0, 0, 0 }, // 1
{ 1, 0, 1, 1, 0, 1, 1, 0 }, // 2
{ 1, 0, 1, 1, 1, 1, 0, 0 }, // 3
{ 1, 1, 0, 1, 1, 0, 0, 0 }, // 4
{ 1, 1, 1, 0, 1, 1, 0, 0 }, // 5
{ 1, 1, 1, 0, 1, 1, 1, 0 }, // 6
{ 0, 0, 1, 1, 1, 0, 0, 0 }, // 7
@roastchicken
roastchicken / cube.lua
Created June 1, 2016 04:17
Draws a cube with 3D2D
local function drawCube( origin, angle, size, color )
local botLeft = origin
local topRight = Vector( botLeft.x + size, botLeft.y - size, botLeft.z + size )
hook.Add( "PostDrawOpaqueRenderables", "drawCube", function()
--bottom
cam.Start3D2D( botLeft, Angle( 0-angle.p, 0-angle.y, 0-angle.r ), 1 )
surface.SetDrawColor( color )
surface.DrawRect( 0, 0, size, size )