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
<svg preserveAspectRatio="xMinYMin" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 560 1388">
<defs>
<mask id="canTopMask">
<image width="560" height="1388" xlink:href="img/can-top-alpha.png"></image>
</mask>
</defs>
<image mask="url(#canTopMask)" id="canTop" width="560" height="1388" xlink:href="can-top.jpg"></image>
</svg>
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@dfrankland
dfrankland / easing.js
Created May 8, 2016 01:42 — forked from AndrewRayCode/easing.js
ES6 module-ified easing functions, based on https://gist.github.com/gre/1650294
// based on https://gist.github.com/gre/1650294
// no easing, no acceleration
export function linear( t ) {
return t;
}
// accelerating from zero velocity
export function easeInQuad( t ) {
return t * t;
@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
<!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 / 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>
@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 / 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 / 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 / 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>