Skip to content

Instantly share code, notes, and snippets.

View ChuckJHardy's full-sized avatar

Chuck J Hardy ChuckJHardy

View GitHub Profile
@ChuckJHardy
ChuckJHardy / localStorageMock.ts
Created March 22, 2019 22:23
Typescript LocalStorage Mock
const localStorageMock = (() => {
let store: IDict = {};
return {
getItem(key: any) {
return store[key] || null;
},
setItem(key: any, value: any) {
store[key] = value.toString();
},
### Keybase proof
I hereby claim:
* I am chuckjhardy on github.
* I am chuckjhardy (https://keybase.io/chuckjhardy) on keybase.
* I have a public key ASDN6G-JWLU8Pn-F7HdCOeMj2z0URHrG3PbkQYifsUV5wAo
To claim this, I am signing this object:
@ChuckJHardy
ChuckJHardy / gist:d4a96885ea6f141ba34658a9ca145522
Created November 11, 2017 18:14
Verifying my Blockstack ID is secured with the address 1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5 https://explorer.blockstack.org/address/1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5
Verifying my Blockstack ID is secured with the address 1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5 https://explorer.blockstack.org/address/1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5
# Queue / Workers
gem "sidekiq"
gem "sidekiq-statistic"
gem "sidekiq-failures"
gem "clockwork", git: "https://github.com/Rykian/clockwork.git"
@ChuckJHardy
ChuckJHardy / command.rb
Created August 22, 2016 11:35
Command Spec
require 'command'
describe Command do
let(:instance) { described_class.new(input, robotic_rover) }
let(:robotic_rover) do
instance_double(
"RoboticRover",
position: '0 0 N',
move: '0 1 N',
@ChuckJHardy
ChuckJHardy / static_map_helper.rb
Created July 20, 2016 10:19 — forked from mcasimir/static_map_helper.rb
Google Maps Static map helper for Ruby on Rails
module StaticMapHelper
def static_map_for(location, options = {})
params = {
:center => [location.lat, location.lng].join(","),
:zoom => 15,
:size => "300x300",
:markers => [location.lat, location.lng].join(","),
:sensor => true
}.merge(options)
@ChuckJHardy
ChuckJHardy / gource.md
Last active August 12, 2022 00:22
Gource Recording for Git

Install Gource

brew install gource

Convert Quicktime Movie to Animated Gif

ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

Record Gource

@ChuckJHardy
ChuckJHardy / microservices.sh
Created February 1, 2016 12:01
Microservices Setup Script
#!/usr/bin/env sh
set -e
blue="\033[34m"
reset="\033[0m"
red="\033[31m"
function warn {
echo "$1" > /dev/stderr
@ChuckJHardy
ChuckJHardy / bloom.sh
Created February 1, 2016 11:55
Project Developer Build Script
#!/usr/bin/env sh
blue="\033[34m"
reset="\033[0m"
red="\033[31m"
green="\033[32m"
function warn {
echo "$1" > /dev/stderr
}
@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active September 19, 2024 05:26
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end