Skip to content

Instantly share code, notes, and snippets.

View jwir3's full-sized avatar

Scott Johnson jwir3

View GitHub Profile
@jwir3
jwir3 / canvasArrowhead.js
Created May 18, 2017 15:18
Code to create an arrowhead on an html5 canvas
/**
* Draw an arrowhead on a line on an HTML5 canvas.
*
* Based almost entirely off of http://stackoverflow.com/a/36805543/281460 with some modifications
* for readability and ease of use.
*
* @param context The drawing context on which to put the arrowhead.
* @param from A point, specified as an object with 'x' and 'y' properties, where the arrow starts
* (not the arrowhead, the arrow itself).
* @param to A point, specified as an object with 'x' and 'y' properties, where the arrow ends
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@JonathanNye
JonathanNye / gist:2229968
Created March 28, 2012 19:55
Simple bottom "stroke" XML drawable for Android View backgrounds
<!-- This produces a 1.5dp stroke along the bottom of a View. It works by drawing the stroke color as the background of the View, then the background color on top, offset up by 1.5dp. Unfortunately, this approach
only works if you have solid color backgrounds. For transparency, you'll have to use a 9patch. -->
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape android:shape="rectangle">
<solid android:color="STROKE_COLOR_HERE"/>