├── LICENSE ├── README.md ├── deploy-extension.sh ├── extension ├── icons │ ├── icon128.png │ ├── icon16.png │ ├── icon19.png │ ├── icon256.png │ └── icon48.png ├── manifest.json └── src │ ├── css │ └── inject.css │ ├── inject │ ├── inject.js │ └── static.js │ └── lib │ └── jquery-2.2.0.min.js └── media ├── demo-video.gif └── demo-video.m4v /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Ben Friedland 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Draw 2 | Allows you to draw in your GitHub heatmap 3 | 4 | ![demo-vid](https://github.com/ben174/git-draw/raw/master/media/demo-video.gif) 5 | 6 | 7 | ##### Created by Ben Friedland - http://www.bugben.com 8 | 9 | 10 | This is a Chrome extension which will allow you to freely draw on your GitHub 11 | heatmap. You can then export your drawing to a script containing a git commit 12 | log. Once you've run and pushed this script to a new repository, your commit 13 | log will match the drawing you made. 14 | 15 | Download the extension here: 16 | 17 | https://chrome.google.com/webstore/detail/git-draw/aapcmdackhlfobmkcpplkjpfceihngkh?hl=en-US&gl=US 18 | 19 | ## Instructional Video 20 | 21 | My Brother, Rich Friedland, made a comprehensive video on how to use the extension. 22 | 23 | https://www.youtube.com/watch?v=ptzDfPZ--Qk 24 | 25 | 26 | ## Why not a bookmarklet? 27 | 28 | Because CSP. GitHub's CSP policy makes a bookmarklet next to impossible. 29 | There's a workaround involving injecting code into a canvas and then executing 30 | it from there, but that feels like something that'll be fixed. A Chrome extension 31 | makes it easier. Once you're done making your drawing, just uninstall the extension. 32 | 33 | ## Acknowledgements 34 | 35 | GitFiti: https://github.com/gelstudios/gitfiti - got the idea from here, and 36 | poked around their src to see how they were writing commit messages. 37 | -------------------------------------------------------------------------------- /deploy-extension.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | rm git-draw.zip 3 | find . -name "*.un~" -exec rm -rf {} \; 4 | zip -r git-draw.zip extension/* -x "*.DS_Store" 5 | 6 | #TODO: Figure out how to deploy to chrome developer dashboard via api 7 | -------------------------------------------------------------------------------- /extension/icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ben174/git-draw/6817757fa861f9011ba438350ba886700fc1dd8b/extension/icons/icon128.png -------------------------------------------------------------------------------- /extension/icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ben174/git-draw/6817757fa861f9011ba438350ba886700fc1dd8b/extension/icons/icon16.png -------------------------------------------------------------------------------- /extension/icons/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ben174/git-draw/6817757fa861f9011ba438350ba886700fc1dd8b/extension/icons/icon19.png -------------------------------------------------------------------------------- /extension/icons/icon256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ben174/git-draw/6817757fa861f9011ba438350ba886700fc1dd8b/extension/icons/icon256.png -------------------------------------------------------------------------------- /extension/icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ben174/git-draw/6817757fa861f9011ba438350ba886700fc1dd8b/extension/icons/icon48.png -------------------------------------------------------------------------------- /extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Git Draw", 3 | "version": "0.0.1", 4 | "manifest_version": 2, 5 | "description": "Allows you to draw in your GitHub heatmap.", 6 | "homepage_url": "http://www.bugben.com", 7 | "icons": { 8 | "16": "icons/icon16.png", 9 | "48": "icons/icon48.png", 10 | "128": "icons/icon128.png" 11 | }, 12 | "permissions": [ 13 | "contentSettings", 14 | "storage" 15 | ], 16 | "content_scripts": [ 17 | { 18 | "matches": [ 19 | "https://github.com/*" 20 | ], 21 | "js": [ 22 | "src/lib/jquery-2.2.0.min.js", 23 | "src/inject/inject.js" 24 | ], 25 | "css": [ 26 | "src/css/inject.css" 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /extension/src/css/inject.css: -------------------------------------------------------------------------------- 1 | 2 | .svg-tip { 3 | display: none; 4 | } 5 | .legend>li.selected { 6 | border: solid 1px #000; 7 | } 8 | .calendar-graph.days-selected rect.day { 9 | opacity: 1!important; 10 | } 11 | 12 | svg { 13 | cursor: crosshair!important; 14 | } 15 | -------------------------------------------------------------------------------- /extension/src/inject/inject.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true*/ 2 | /*global Promise, chrome*/ 3 | "use strict"; 4 | 5 | var gf = { 6 | init: function() { 7 | $("rect[data-count]").each(function(i, item) { 8 | gf.maxCommits = Math.max(gf.maxCommits, item.getAttribute("data-count")); 9 | }) 10 | gf.commitBlockSize = Math.ceil(gf.maxCommits/4); 11 | $(".legend>li").unbind("click").click(gf.setBrush); 12 | $("svg rect").unbind("click").on("mousedown", gf.colorCell); 13 | $("svg rect").on("mouseover", gf.cellOver); 14 | var btnGroupNode = $("
").addClass("btn-group"); 15 | var renderBtnNode = $("