Skip to content

Instantly share code, notes, and snippets.

View dfrankland's full-sized avatar
🏕️
Catching Pokemon

Dylan Frankland dfrankland

🏕️
Catching Pokemon
View GitHub Profile
@dfrankland
dfrankland / legs.txt
Created October 25, 2018 16:54 — forked from lynaghk/legs.txt
Raw data for a shipping puzzle: https://kevinlynagh.com/notes/shipping-puzzle/
1 LOS_ANGELES CHARLOTTE F
2 CHARLOTTE NEW_YORK W
3 NEW_YORK JACKSONVILLE F
4 JACKSONVILLE SAN_JOSE R
5 SAN_JOSE DETROIT T
6 DETROIT SEATTLE R
7 SEATTLE AUSTIN T
8 AUSTIN COLUMBUS W
9 COLUMBUS PHILADELPHIA T
10 PHILADELPHIA PHOENIX T
@dfrankland
dfrankland / 0___rust_serde_json_wasm_parcel___0.md
Created July 21, 2018 02:41 — forked from neoeinstein/0___rust_serde_json_wasm_parcel___0.md
Rust-to-JS JSON string exchange (parcel.js, wasm)

Rust, serde-json, wasm, parcel.js

With this combination it is fairly easy to get things done in Rust and utilize it in JavaScript. Yay!

@dfrankland
dfrankland / to_c_or_not_to_c.md
Created July 9, 2018 04:57 — forked from ISSOtm/to_c_or_not_to_c.md
Writeup discussing programming toolchains, coding practices, and languages, for GB and GBC dev.

In the past few years, it seems that, as retro gaming has grown in popularity, programming for older platforms has also gained traction. A popular platform is the Game Boy, both for its nostalgia and (relative) ease to program for.

Important: this document only applies to the Game Boy and Game Boy Color. Game Boy Advance programming has nothing in common with Game Boy programming. If you want to program for the GBA, which is much more C-friendly (and C++ and Rust, for that matter) than the GB and GBC, then I advise you download devkitARM and follow the Tonc tutorial. Please note that the Game Boy Advance also functions as a Game Boy Color, so if you only have a GBA, you can use it for both GB and GBC development.

When someone wants to make their own game, one of the first problems they will encounter is picking the tools they will use. There are two main options: either use GBDK (Game Boy Development Kit) and the language C, or RGBDS (Rednex Game Boy Development

@dfrankland
dfrankland / app.js
Created March 18, 2018 22:10 — forked from souporserious/app.js
Generate an array of React documentation using babel-plugin-preval and react-docgen.
// make sure to have babel-plugin-preval setup so this import works as expected
// https://github.com/kentcdodds/babel-plugin-preval
import docs from "./get-react-docs.js"
// do whatever you want with all of the component documentation
function renderDocs() {
return (
<div>
{docs.map(doc => ...)}
</div>
@dfrankland
dfrankland / main.rs
Created October 27, 2017 05:10 — forked from steveklabnik/main.rs
The Results of the Expressive C++17 Coding Challenge in Rust
use std::env;
use std::io;
use std::io::prelude::*;
use std::fs::File;
#[derive(Debug)]
enum Error {
Io(io::Error),
Program(&'static str),
}
@dfrankland
dfrankland / feature-detect flexbox.js
Created May 13, 2017 21:41 — forked from davidhund/feature-detect flexbox.js
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
@dfrankland
dfrankland / fuckuanova.js
Last active April 25, 2017 00:36 — forked from TheUbuntuGuy/fuckuanova.py
Decode Anova Precision Cooker WiFi Packets
const decoder = packetBuf => {
const bytes = [...packetBuf];
const { string: command } = bytes.reduce(
({ chksum, string }, byte, index) => {
let newChecksum = chksum;
let newString = string;
if (index === bytes.length - 2) {
newChecksum &= (2 ** 8) - 1; // eslint-disable-line no-bitwise
if (byte !== newChecksum) {
throw new Error(`Chksum: FAIL. Read: ${byte} != calc'd: ${chksum}`);
@dfrankland
dfrankland / fonts.conf
Created December 20, 2016 05:52 — forked from BojanStipic/fonts.conf
Linux color emoji
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>NotoSans</family>
<family>NotoColorEmoji</family>
<family>NotoEmoji</family>
</prefer>
<!doctype html>
<html ng-app="myApp">
<head>
<title>JS Bin</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body ng-controller="myCtrl">
<spinner load="loading">
<blah yo="otherScopeVariable" ></blah>
</spinner>
@dfrankland
dfrankland / resize.fish
Last active February 15, 2021 21:42 — forked from gingertom/resizer.sh
Simple `imagemagick` fish shell script to convert all @2x images in a directory to @1x. Place file in `~/.config/fish/functions/`, then run like normal: `resize`!
function resize --description "Resize images from @2x to @1x in current directory."
for image in *
echo $image | grep -qE '.*@2x.*'; and \
convert $image -resize 50% (echo $image | sed "s/@2x/@1x/g")
end
end