Skip to content

Instantly share code, notes, and snippets.

View dannypage's full-sized avatar

Danny Page dannypage
View GitHub Profile
braidn / Dockerfile
Last active June 27, 2020 22:08
Crystal Devcontainer
RUN apt-get update && \
apt-get install -y build-essential curl libevent-dev libssl-dev libxml2-dev libyaml-dev libgmp-dev git && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -sL "" | apt-key add - && \
echo "deb crystal main" | tee /etc/apt/sources.list.d/crystal.list && \
apt-get update
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
mikepqr /
Last active September 27, 2021 04:19
Make printouts from Firefox Reader mode look like NYRB artices

printout with this stylesheet

See this tweet for how I use this.

To install in Firefox:

  1. If it doesn't already exist, create a folder called chrome in your profile folder. The easiest way to find your profile folder is in about:profiles (there's a "Show in Finder" link for the folder on macOS). Be sure to choose the right profile is you have more than one.

  2. Put userContent.css above in the chrome folder you just created.

amirrajan / pong.rb
Last active June 4, 2024 19:16
Pong in DragonRuby Game Toolkit
def tick args
defaults args
render args
calc args
input args
def defaults args
args.state.ball.debounce ||= 3 * 60
args.state.ball.size ||= 10
class Game
attr_accessor :args, :state, :inputs, :outputs, :grid
def update_line_of_sight
variations = [-1, 0, 1]
newly_visible = variations.product(variations).flat_map do |rise, run|
thick_line_of_sight state.x, state.y, rise, run, 15,
lambda { |x, y| dungeon_cell_exists? x, y }
icculus / basicgorillas.rb
Last active June 21, 2023 02:10
DragonRuby Basic Gorillas
# This is the complete source code to Basic Gorillas:
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# Amir Rajan wrote this game, catch him at !
class YouSoBasicGorillas
attr_accessor :outputs, :grid, :game, :inputs
# This is the complete source code to Flappy Dragon:
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# Amir Rajan wrote this game, catch him at !
class FlappyDragon
attr_accessor :grid, :inputs, :game, :outputs
wndxlori / main.rb
Last active May 8, 2019 21:53
DragonRuby Game Toolkit Tutorial - Galaga clone...a new beginning
# the first 2 or 4 values of the primitive conventionally are x, y, (w, h, or x2, y2)
# the last 4 values conventionally are r, g, b, a (color)
# custom values for primitive are in the middle
# labels x, y, text, size, alignment, r, g, b, a
# sprites x, y, w, h, path, angle, alpha
# lines x, y, x1, y1, r, g, b, a
# solids x, y, w, h, r, g, b, a
# borders x, y, w, h, r, g, b, a
# sounds ".wav|.ogg"
amirrajan / mod.rb
Last active May 8, 2019 21:53
# Press escape the open up the DragonRuby Hud and type the following code
def after_tick game_state
game_state.solids << [0, 0, 100, 100, 255, 0, 0]
# after typing the code above press Shift+Enter
FuzzySlipper / JsonDB.cs
Created September 18, 2018 20:23
Runtime CastleDB file reader
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using SimpleJSON;
namespace PixelComrades {
public class JsonDB {
private const string Id = "ID";
private const string EnumProp = "hasIndex";