Skip to content

Instantly share code, notes, and snippets.

View bradherman's full-sized avatar

Bradley Herman bradherman

View GitHub Profile
Key strategies & goals
Target’s sustainability programme is branded “Target Forward”.  Some of the major pillars include:
1. Climate & greenhouse gas (GHG) emissions
• Target commits to achieving net zero greenhouse gas emissions (scope 1, 2 and 3) across its enterprise by 2040. 
• Near-term goals include: by 2030 reduce absolute scope 1 and 2 emissions by 55% (vs 2017 baseline) and scope 3 emissions by 32.5% below 2017 levels. 
• To enable this, Target is focusing on energy efficiency, adoption of renewable energy (e.g., solar, wind), upgrading refrigerants, transportation/fulfillment emissions reductions and supplier engagement. 
2. Circularity & waste reduction

Keybase proof

I hereby claim:

  • I am bradherman on github.
  • I am bradleyherman (https://keybase.io/bradleyherman) on keybase.
  • I have a public key ASCiHwO_EuB4Iy6_OyaO-7oHNsC3fJ9B-SUUWJExnSFmjQo

To claim this, I am signing this object:

import { action, computed, decorate, observable, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import RelativeTime from 'react-relative-time';
import { NavLink } from 'react-router-dom';
import { Badge, Button } from 'reactstrap';
import { client } from '../../helpers/client';
import { EarningModal } from '../Modals/EarningModal';
import { SmartTable } from '../SmartTable/SmartTable';
import { Earning } from '../../models/Earning';
# config/unicorn.rb
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 60
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
@bradherman
bradherman / blur.rb
Created August 10, 2016 05:04 — forked from christianroman/blur.rb
Blurring images in Rails with Paperclip custom processor
module Paperclip
class Blur < Processor
def initialize file, options = {}, attachment = nil
super
@format = File.extname(@file.path)
@basename = File.basename(@file.path, @format)
end
def rle(str)
current = {}
str.chars.each_with_object([]) do |char, arr|
if current.empty?
current = {"#{char}": 1}
elsif current.keys.first == char.to_sym
current[:"#{char}"] += 1
else
arr << current
current = {"#{char}": 1}
@bradherman
bradherman / gist:8052588
Created December 20, 2013 09:47
Shelfari API example
curl 'http://www.shelfari.com/ws/json/ShelfariService.ashx' --data-binary '{"id":0,"method":"getShelfBooks","params":{"0":2504331,"1":2504331,"2":2,"3":"","4":"dateadded","5":2,"6":40,"7":0,"8":160}}' --compressed
0 - id of lookup
1 - id of you
2 - type of search (0: all, 1: favorites, 2: plans to read, 3: wishlist, 4: read, 5: owns, 6: reading, 100: common)
3 - leave blank
4 - sort type (dateadded, rating, opinions, datepublished, author, title)
5 - page
6 - 40
@bradherman
bradherman / gist:5314957
Created April 4, 2013 22:33
Array method that will pull out and return matching items from the array, leaving non-matching items in the original.
class Array
def pop_if!(&block)
a,b = self.partition(&block)
self.replace(b)
a
end
end
@bradherman
bradherman / gist:3991226
Created November 1, 2012 02:18
An Open Letter to Best Buy
As a kid, I couldn't remember anything better than getting to go to Best Buy. All the gadgets and games made it seem almost magical. I could play with the newest and greatest gaming consoles, watch the biggest and best tv's, and get a glimpse at the future of technological achievement. It was awesome. As I grew older, I continued to go to Best Buy for all of my electronic entertainment needs. Through high school and college, I'd show up on Tuesdays to purchase the newest dvd's and video games I'd been anticipating for weeks or months with what little money I had earned working through summers and weekends. I remember buying my first flat screen CRT TV at Best Buy and thinking it was amazing. I remember buying my first HDTV there years later. I waited outside of Best Buy for nearly a day in the rain for the new XBOX 360. I waited outside of another Best Buy for over a day in below freezing weather through snow and sleet for the Playstation 3. Just a few months ago, I purchased another XBOX 360 and a
@bradherman
bradherman / Gemfile
Created September 14, 2012 03:39
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin