You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Going to leave this here for next time I need to push or pull to a git repo that's blocked on a network. In my case it was a self hosted Gitlab server.
I've got an SSH tunnel setup through PuTTY running on port 1234. Run this before pushing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tapermonkey script to add Travis CI badges to GitHub Classroom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Needed a way to reference a form on the window that opened a JavaScript pop-up. This seems to work, although there's probably a better way.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get a "web safe" color based on string contents in PHP
Get color for string in PHP
I've needed to do this a couple of times, so I guess it's time to save it as a Gist for next time.
What I needed was a way to calculate a color based on string contents, where the same string would always generate the same color.
I also wanted the colors generated to be part of the web safe palette. Not that there's
any reason to stay in that palette for browsers now, but I wanted to keep the possible palette relatively small and have colors
that generally look okay together. The math behind the web safe palette made it pretty easy.
As it works out, all of the web safe colors are multiples of 51. We'll need that bit of trivia in a second...