Skip to content

Instantly share code, notes, and snippets.

View jah2488's full-sized avatar

Justin Herrick jah2488

View GitHub Profile
@jah2488
jah2488 / debug_css.js
Last active January 3, 2023 21:53
Fun little one liner to do some debugging css.
function debugAll() {
[].forEach.call($$('*'), function(a) {
function cr() { return 0|(Math.random() * 255); };
a.style.outline = '2px solid rgba(' + [cr(), cr(), cr()].join(',') + ', 0.44)';
});
}
@jah2488
jah2488 / coin-changer-kata.md
Created October 13, 2021 16:11
Description of the Coin Changer Kata

Coin Changer Kata

Description

Using the RGR (Red. Green. Refactor.) loop of TDD, write a method that accepts an positive integer value and returns an array of the smallest amount of change possible for that amount.

Examples

change(99) #=> [25, 25, 25, 10, 10, 1, 1, 1, 1]
change(72) #=> [25, 25, 10, 10, 1, 1]
find * -name package.json | xargs grep '"license[s]*"' -A 3 | grep -o ': ".*"' | xargs ruby -e "puts ARGV.reduce({}) { |acc, n| acc[n] = (acc[n] || 0) + 1; acc }"
@jah2488
jah2488 / image.md
Last active April 16, 2021 16:49
Creates a Menubar application using Node Webkit and Opal

A tiny app using opal.rb and nodewebkit to get your weather in your toolbar. so small

@jah2488
jah2488 / .local.vimrc
Last active January 30, 2021 07:58
Basic VIM setup
filetype plugin indent on " Turn on plugins, auto indentation, and syntax highlighting
set nocompatible " Use Vim settings, rather then Vi settings
set nobackup " Stop vim from leaving temp files everywhere
set nowritebackup " Don't write your undo history to a file
set history=200 " Only save 200 undos
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set vb " NO BELLS!
@jah2488
jah2488 / raycast.hx
Created April 29, 2014 18:56
A simple raycasting proof of concept I did a few months back in haxe/openfl. Think of the original doom. Its kinda like that.
package;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.Lib;
import flash.ui.Keyboard;
import flash.Vector;
@jah2488
jah2488 / 1-solution.rb
Created May 17, 2019 16:23
The many phases of Raindrops from Exercism.
require 'prime'
module Raindrops
extend self
def convert(n)
primes = n.prime_division.flatten
if primes.any? { |x| [3,5,7].include?(x) }
primes.map do |x|
case x
when 3 then 'Pling'
# Sample usage
# cd to book folder
# ruby feed_seeder.rb && dropcaster > index.rss && aws s3 sync . "s3://audiobooks-rss/My Book Name" --acl public-read
require 'colorize'
require 'optparse'
DEFAULT_DESCRIPTION = "Books are cool"
DEFAULT_IMAGE = "https://pbs.twimg.com/profile_images/378800000448533787/c32fb13e160ee7cd17848e8cacbbcfc5_400x400.jpeg"
DEFAULT_PATH = "."
@jah2488
jah2488 / elm.md
Last active March 22, 2018 18:05

Elm Resources

So you want to learn Elm? Excited to hear it. To get started, its going to help to have some guidance along the way. Below I've collected various helpful resources and tips to get you started.

Starting Out

Things To Do

{
"questions": [
{
"id": 1,
"displayName": "Favorite Food?",
"type": "text"
},
{
"id": 2,
"displayName": "Favorite Character Build",