Skip to content

Instantly share code, notes, and snippets.

View dannypage's full-sized avatar
https://danny.page

Danny Page dannypage

https://danny.page
View GitHub Profile
@dannypage
dannypage / firefox-reader-mode.md
Last active September 24, 2021 00:27 — forked from mikepqr/README.md
Make printouts from Firefox Reader mode look like dang NYRB artices

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.

  3. Load about:config in Firefox then set toolkit.legacyUserProfileCustomizations.stylesheets to true.

  4. Quit and reopen Firefox, just for luck.

@dannypage
dannypage / twitter_font_adblock.txt
Created August 24, 2021 21:44
How to block Twitter's terrible font
# Go to uBlock's options and paste in the following under the "My Filters" tab
https://abs.twimg.com/fonts/chirp-bold-web.woff
https://abs.twimg.com/fonts/chirp-heavy-web.woff
https://abs.twimg.com/fonts/chirp-regular-web.woff
https://abs.twimg.com/fonts/v2/chirp-bold-web.woff
https://abs.twimg.com/fonts/v2/chirp-heavy-web.woff
https://abs.twimg.com/fonts/v2/chirp-medium-web.woff
https://abs.twimg.com/fonts/v2/chirp-regular-web.woff
@dannypage
dannypage / color_palatte.rb
Created May 11, 2019 20:21
A sample DragonRuby program to display a few learnings; How to include new classes, create buttons to update state, manage the update loop, and easily add new color schemes.
class ColorPalatte
attr_accessor :colors
def initialize clrs
clrs.each_with_index do |c, i|
clrs[i] = hex_to_rgb c
end
@colors = clrs
end
@dannypage
dannypage / basicgorillas.rb
Created May 8, 2019 21:51 — forked from icculus/basicgorillas.rb
DragonRuby Basic Gorillas
# This is the complete source code to Basic Gorillas:
# https://dragonruby.itch.io/basicgorillas
#
# You can tinker with this by getting a copy of DragonRuby Game Toolkit:
# https://dragonruby.org/
#
# Amir Rajan wrote this game, catch him at https://twitter.com/amirrajan !
class YouSoBasicGorillas
attr_accessor :outputs, :grid, :game, :inputs
@dannypage
dannypage / README.md
Last active January 15, 2019 05:04
SCRIPT-8
<div id="locations-nav-dropdown" class="locations-dropdown-displayed">
<div class="table">
<div class="tc" id="locations-dropdown-paj-cell">
<div class="locations-dropdown-paj text-center">
<div class="fs-24 text-bold">Did you know?</div>
<img class="did-you-know-img marg-t-10 marg-b-20" src="https://rcdn.upcounsel.com/assets/magnifying_people@2x-471c0a20b9f45dc81041f953bec75c820d71a9446f463f5d264c93fa8d1e39da.png" alt="Magnifying people@2x">
<div class="fs-13 text-bold">
No need to spend hours finding a lawyer, post a job and get custom quotes from experienced lawyers instantly.
</div>
<a class="btn btn-success text-uppercase marg-t-20 track-click-paj" href="/jobs/new">Post a Job</a>
@dannypage
dannypage / sample_queries.sql
Created September 13, 2017 19:41
Hockey SQL Tutorial - Postgres 9.6 - http://sqlfiddle.com/#!17/8395d/4/0
-- All players in the Hall of Fame table.
SELECT *
FROM "Hall of Fame";
-- All players in the Hall of Fame table, ordered by points.
SELECT *
FROM "Hall of Fame"
ORDER BY "Points" desc;
-- All players in the Hall of Fame table, with at least 1000 points.
@dannypage
dannypage / chain.rb
Last active July 28, 2017 19:25
Trying to solve the chain problem by brute force. Uses 4 cores with the Parallel gem. https://fivethirtyeight.com/features/pick-a-number-any-number/
# ruby chain.rb &
# writes to /tmp/chain_results.log
require 'parallel'
def number_chain( n, range, chain)
chain << n
range.delete(n)
next_numbers = []
@dannypage
dannypage / concrete-v03.rb
Created October 10, 2016 14:01 — forked from AlexandreRangel/concrete-v03.rb
Sonic Pi music code
# Alexandre rANGEL www.quasecinema.org
# born out of concrete v03
# 9/Oct/2016
# Sonic Pi 2.11 dev
use_bpm 120
live_loop :notes1 do
with_bpm 240 do
x = tick
@dannypage
dannypage / Wikidata_stadium_lat_long.tsv
Last active May 11, 2020 17:26
@deepxg created a query to hit Wikidata for all stadiums and their lat&long as known by Wiki - URL in second file.
countryName leagueName teamName venueName lat long
Abkhazia Abkhazian Football Championship FC Dinamo Sukhumi
Abkhazia Abkhazian Football Championship Nart Sukhum
Afghanistan Kabul Premier League Ariana Kabul F.C. Ghazi Stadium 34.518531 69.193711
Afghanistan Kabul Premier League Hakim Sanayi Kabul F.C.
Afghanistan Kabul Premier League Javan Azadi Kabul F.C. Ghazi Stadium 34.518531 69.193711
Afghanistan Kabul Premier League Maiwand Kabul F.C. Ghazi Stadium 34.518531 69.193711
Afghanistan Kabul Premier League Ordu Kabul F.C.
Afghanistan Kabul Premier League Pamir Kabul F.C.
Afghanistan Kabul Premier League Real Afghan Kabul