Skip to content

Instantly share code, notes, and snippets.

View fcard's full-sized avatar

fcard

View GitHub Profile
@fcard
fcard / cohost_toaster_overlay.js
Created July 29, 2023 00:21
Cohost Toaster Overlay
// ==UserScript==
// @name Cohost Toaster Overlay
// @namespace https://cohost.org/
// @version 0.1
// @description bring back teh toasters
// @author \phi
// @match https://cohost.org/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@fcard
fcard / ancilla_example.asm
Last active February 12, 2021 23:10
Example Ancilla Object for Zelda 3
; -- Ancilla Example --
!AssembleExampleAncilla = 1 ; Boolean to enable assembling the subroutines
; for the Example ancilla object.
; 1 = Yes; 0 = No
if !AssembleExampleAncilla != 0
AncillaExt_AddExample: ; Subroutine to create ancilla object
LDA #$44 ; `A` register must be the ancilla object's id/index
JSL AddAncillaLong ; Call this to actually create the object
@fcard
fcard / defaultreverse.jl
Last active January 13, 2021 17:37
Applications for IteratorIndexable
import Base: iterate
struct Reverse{T}
itr::T
end
reverse(itr) = Reverse(itr)
reverse(r::AbstractRange) = Base.reverse(r)
Base.eltype(::Type{Reverse{T}}) where T = eltype(T)
@fcard
fcard / LICENSE.txt
Last active January 7, 2021 22:04
Implementing Reverse for Take, Drop, TakeWhile, & DropWhile
Copyright © 2021 Fcard
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEA
@fcard
fcard / .gitignore
Last active September 12, 2020 20:20
popbench.sh: benchmarks for pop.sh
/benchmarks
/bench
@fcard
fcard / .gitignore
Last active September 12, 2020 19:08
Pop.sh: Shell functions to remove the last positional argument
/popbench_gist
/popsh
@fcard
fcard / cons.jl
Last active March 7, 2019 00:01
Simple Printf constructed using the generated functions from the julia language
"""
exports fmt and @fmt, functions to build
format specifiers in an alternate
way to @fmt_str
"""
module Cons
export fmt, @fmt
import Base: @pure
import ..GenPrintf: PrintArgument, PrintValue,
PrintBoth, FormatSpecifier
@fcard
fcard / pride_flag.jl
Last active January 12, 2019 04:10
Pride flag/gradient generator in julia
#!/usr/bin/env julia
module PrideFlag
using Cairo
function make_flag(n, file; line_width=1)
@assert n <= 256
i = 0
f = filtered_colors(n)
w = length(f) * line_width
@fcard
fcard / ExprKw.jl
Created April 23, 2017 00:46
Transform expressions into functions where free variables are turned into keyword arguments
module ExprKw
export Missing, @kw, @arg, @noarg
type Missing{Var,T} <: Exception ex::T end
Base.showerror{Var}(io::IO, err::Missing{Var}) = println(io, "Missing variable $Var in expression ($(err.ex))")
@generated function check_for_missing(args...)
for i in eachindex(args)
args[i] <: Missing && return :(throw(args[$i]))
end
@fcard
fcard / vimscript_parser.vim
Created March 28, 2017 23:01
Vimscript parser in vimscript. Sure why not
" Command: Command
"
" A different take on command creation,
" Command creates a namespace for which
" its implementation functions can be
" stored in. The command name also comes
" first, followed by its argument type
" in parentheses, to mimic function
" definitions. name Anything preceding a ':='
" command body.