Skip to content

Instantly share code, notes, and snippets.

Avatar

Chuck J Hardy ChuckJHardy

View GitHub Profile
@ChuckJHardy
ChuckJHardy / localStorageMock.ts
Created Mar 22, 2019
Typescript LocalStorage Mock
View localStorageMock.ts
const localStorageMock = (() => {
let store: IDict = {};
return {
getItem(key: any) {
return store[key] || null;
},
setItem(key: any, value: any) {
store[key] = value.toString();
},
View gist:f6aca9ed9bd967bd08178c801d4a8cb1
### 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 Nov 11, 2017
Verifying my Blockstack ID is secured with the address 1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5 https://explorer.blockstack.org/address/1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5
View gist:d4a96885ea6f141ba34658a9ca145522
Verifying my Blockstack ID is secured with the address 1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5 https://explorer.blockstack.org/address/1L2WKTJbQV4da4RwRmaSRAx114K8M6Uzg5
View Gemfile
# Queue / Workers
gem "sidekiq"
gem "sidekiq-statistic"
gem "sidekiq-failures"
gem "clockwork", git: "https://github.com/Rykian/clockwork.git"
View command.rb
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 Jul 20, 2016 — forked from mcasimir/static_map_helper.rb
Google Maps Static map helper for Ruby on Rails
View static_map_helper.rb
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 Jul 23, 2020
Gource Recording for Git
View gource.md

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 Feb 1, 2016
Microservices Setup Script
View microservices.sh
#!/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 Feb 1, 2016
Project Developer Build Script
View bloom.sh
#!/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 Sep 30, 2020
Example ActiveJob with RSpec Tests
View example_activejob.rb
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
You can’t perform that action at this time.