Skip to content

Instantly share code, notes, and snippets.

View jaketrent's full-sized avatar
🎹
Coding a power ballad

Jake Trent jaketrent

🎹
Coding a power ballad
View GitHub Profile
#!/usr/bin/env ruby
verbose = ARGV[0] == '-v'
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
@jaketrent
jaketrent / searchPointsTally.js
Created September 15, 2014 14:44
Bookmarklet to tally story points on Jira Search page
javascript:var s=document.createElement('script');s.setAttribute('src','https://code.jquery.com/jquery.js');document.getElementsByTagName('body')[0].appendChild(s);var sum=0;$(".customfield_10004").each(function(){sum+= parseInt($(this).text(), 10);});var t=$('<span class="badge aui-badge" style="margin-left: 6px;"></span>');var h=$(".headerrow-customfield_10004");h.append(t);t.html(sum);
@jaketrent
jaketrent / client.html
Last active August 29, 2015 14:07
Most-Vanilla Node Server
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script>
$(function() {
$.get('http://localhost:3000')
});
</script>
</head>
</html>
@jaketrent
jaketrent / deleteable-state.js
Created December 4, 2014 03:01
React delete state
var React = require('react')
var clone = require('lodash-node/modern/objects/clone')
module.exports = {
deleteState(stateAttrNames, done) {
if (!stateAttrNames) {
if (typeof done === 'function') return done()
return
@jaketrent
jaketrent / svg_grad.html
Created December 18, 2014 22:48
SVG Gradient
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>SVG Grad</title>
<style type="text/css">
body {
font-family: sans-serif;
}
.line {
@jaketrent
jaketrent / strokeGradient.html
Created December 22, 2014 19:42
Gradient following stroke path // source http://jsbin.com/hefomaroru
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Gradient following path stroke</title>
<style>
svg {
outline: 1px solid #ababab;
}
.line {
@jaketrent
jaketrent / pathMaskGradient.html
Created December 22, 2014 20:11
Gradient along path, using path as mask // source http://jsbin.com/qaqaworene/7/edit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vertical gradient along path</title>
<style>
svg {
outline: 1px solid #ababab;
background: #fff;
}
@jaketrent
jaketrent / fillSvgContainer.html
Created December 23, 2014 15:48
100% Height/Width Fills SVG Container // source http://jsbin.com/juvevadeke/1/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>100% Height/Width Fills SVG Container</title>
<style>
svg {
display: block;
margin: 30px;
outline: 5px solid #0099ff;
@jaketrent
jaketrent / initialProps.js
Created April 9, 2015 16:00
React initial props for server render
var React = require('react')
var Comp = React.createClass({
getInitialState: function () {
return {
books: []
}
},
componentWillMount: function () {
console.log('this.props', this.props)
@jaketrent
jaketrent / initialPropsFromReactRouter.js
Last active August 29, 2015 14:18
React-router initial props
var React = require('react')
var Router = require('react-router')
var Route = React.createFactory(Router.Route)
var Comp = React.createClass({
getInitialState: function () {
return {
books: []
}
},