Skip to content

Instantly share code, notes, and snippets.

View jwo's full-sized avatar

Jesse Wolgamott jwo

View GitHub Profile
@jwo
jwo / example-action.js
Created August 22, 2016 21:27
Getting React and Redux React and Rails and Fetch and Safari to play nice.
export function saveOfficeStaff(section, staff) {
return (dispatch, getState) => {
const issue = getState().newsletterId;
const theData = {
staff: staff,
section_id: section.id
}
fetch(`/api/newsletters/${issue}/office_staff`, {
@jwo
jwo / init.sh
Created December 12, 2016 21:46
A simple shell script which I used for productivity. Mostly, how can you ask a question on command line and then use later. NOTHING EARTH SHATTERING, just me saving for future.
select whichtype in "Authoring" "Semantics" "Syntax" "Forms" "Storage"; do
case $whichtype in
Authoring ) break;;
Semantics ) break;;
Syntax ) break;;
Forms ) break;;
Storage ) break;;
esac
done

Keybase proof

I hereby claim:

  • I am jwo on github.
  • I am jwo (https://keybase.io/jwo) on keybase.
  • I have a public key ASAJZhNvpvuI6EJyOxva6TZ0zBCpxaWUTNvsy38y38ybcAo

To claim this, I am signing this object:

@jwo
jwo / calendar.rb
Created October 6, 2016 13:39
Create a calendar (array of weeks, each an array of days).
class Calendar
attr_reader :date
def initialize(date)
@date = date
end
HEADER = %w(Sunday Monday Tuesday Wednesday Thursday Friday Saturday).freeze
START_DAY = :sunday
@jwo
jwo / docker.notes.md
Created September 20, 2016 13:26
Steps to publishing a docker image, tagged
  1. Create a project directory
  2. Create a Dockerfile inside
  3. docker build .
  4. Will give you a container id as output, eg: d774c9ed0183
  5. docker tag d774c9ed0183 jwolgamott/tiy-dotnet-runnable:0.4-beta
  6. docker push jwolgamott/tiy-dotnet-runnable:0.4-beta

Then, people will be able to docker run jwolgamott/tiy-dotnet-runnable:0.4-beta

@jwo
jwo / dr_spec.rb
Created February 29, 2012 16:54
DRY Mongoid modules
#http://jessewolgamott.com/blog2012/02/29/the-one-where-we-dry-up-mongoid-and-rspec-using-shared-examples-and-modules/
require 'spec_helper'
module Contactable
def self.included(receiver)
receiver.class_eval do
field :first_name, type: String
field :last_name, type: String
@jwo
jwo / extra-credit.md
Created March 2, 2016 19:55
Extra Credit in TIY Backend Engineering
def 😮 🍽
if ["🍕", "🌮"].include? 🍽
puts "yummmmmm"
else
puts "get out"
end
end
😮 "🌮"
@jwo
jwo / parse2 guide.rb
Created February 18, 2016 13:36
parse2 guide.rb
## Post Object
Http.with_headers("X-Parse-Application-Id" => $parse_application_id).post("http://$yourserver.herokuapp.com/parse/classes/GameScore", json: {score:1337,playerName:"Sean Plott",cheatMode: false}
=> {"results"=>[{"objectId"=>"We2so7njJV", "score"=>1337, "playerName"=>"Sean Plott", "cheatMode"=>false, "updatedAt"=>"2016-02-18T11:55:37.367Z", "createdAt"=>"2016-02-18T11:55:37.367Z"}]}
## Get object
Http.with_headers("X-Parse-Application-Id" => $parse_application_id).get("http://$yourserver.herokuapp.com/parse/classes/GameScore")