Skip to content

Instantly share code, notes, and snippets.

View RightHandedMonkey's full-sized avatar

RightHandedMonkey RightHandedMonkey

View GitHub Profile
//Originally from http://plnkr.co/edit/gcjJgFcMs189rF1ucGQa?p=preview
========================= CSV ===========================
"id","order","score","weight","color","label"
"FIS",1.1,59,2,"#9E0041","Fisheries"
"MAR",1.3,24,0.5,"#C32F4B","Mariculture"
"AO",2,98,1,"#E1514B","Artisanal Fishing Opportunities"
"NP",3,60,1,"#F47245","Natural Products"
"CS",4,74,1,"#FB9F59","Carbon Storage"
"CP",5,70,1,"#FEC574","Coastal Protection"
"TR",6,42,1,"#FAE38C","Tourism & Recreation"
@RightHandedMonkey
RightHandedMonkey / D3ChartLifecycleSample.html
Last active April 16, 2022 20:13
Full example D3 that shows the lifecycle of charts including: selection, implicit update, enter() and exit()
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="heybutton" onclick="clickme()">Update</button>
@RightHandedMonkey
RightHandedMonkey / sam_zsh_theme
Created August 3, 2017 01:34
Sam's zsh Theme (Modified Muse)
#!/usr/bin/env zsh
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
setopt promptsubst
autoload -U add-zsh-hook
PROMPT_SUCCESS_COLOR=$FG[117]
PROMPT_FAILURE_COLOR=$FG[124]
PROMPT_VCS_INFO_COLOR=$FG[242]
@RightHandedMonkey
RightHandedMonkey / capture_click_return_css_selector.js
Last active October 1, 2017 18:17
Generates the CSS selector based on the item clicked on in Javascript
(function() {
var CssSelectorGenerator, root,
indexOf = [].indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (i in this && this[i] === item) return i;
}
return -1;
};
CssSelectorGenerator = (function() {
@RightHandedMonkey
RightHandedMonkey / TestUtils.java
Created September 13, 2017 15:22
Android get thread names
class TestUtils {
public static String getThreadDetails() {
if (Looper.myLooper() == Looper.getMainLooper())
return "Currently running on the main thread. "+getThreadName();
else
return "Not running on the main thread. "+getThreadName();
}
public static String getThreadName() {
return Thread.currentThread().getName()+" - "+Thread.currentThread().getId();
@RightHandedMonkey
RightHandedMonkey / style.less
Created October 23, 2017 21:28
Atom visible scrollbar
/*
* Your existing stylesheet
*/
.editor,
.tree-view-resizer {
::-webkit-scrollbar {
width: 2em;
height: 2em;
}
@RightHandedMonkey
RightHandedMonkey / get_android_db.sh
Created October 24, 2017 12:20
Gets the sqlite database of a debug build of your app
#!/bin/bash
REQUIRED_ARGS=2
ADB_PATH=/Users/Tadas/Library/sdk/platform-tools/adb
PULL_DIR="~/"
if [ $# -ne $REQUIRED_ARGS ]
then
echo ""
echo "Usage:"
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.Map;
public class NetworkTest {
@RightHandedMonkey
RightHandedMonkey / jira_issue_copy_button.js
Last active May 18, 2023 12:11
JIRA Issue Copy Button (tampermonkey script) - Adds a copy button to JIRA issues for pasting into slack and others
// ==UserScript==
// @name Jira Issue Copy Button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add a copy button on the tickets so we can Copy ticket number and summary with just one click to share somewhere else
// @author Sam Bossen
// @match https://jira.audible.com/*
// @grant none
// ==/UserScript==