Skip to content

Instantly share code, notes, and snippets.

@jwo
jwo / create_project.sh
Created May 22, 2017
Sample Shell script
View create_project.sh
#!/bin/bash
echo 'So you want to create a new project, eh?'
echo 'What is the name of the project?'
read project_name
mkdir $project_name
@jwo
jwo / init.sh
Created Dec 12, 2016
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.
View init.sh
select whichtype in "Authoring" "Semantics" "Syntax" "Forms" "Storage"; do
case $whichtype in
Authoring ) break;;
Semantics ) break;;
Syntax ) break;;
Forms ) break;;
Storage ) break;;
esac
done
View keybase.md

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 Oct 6, 2016
Create a calendar (array of weeks, each an array of days).
View calendar.rb
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 Sep 20, 2016
Steps to publishing a docker image, tagged
View docker.notes.md
  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 / example-action.js
Created Aug 22, 2016
Getting React and Redux React and Rails and Fetch and Safari to play nice.
View example-action.js
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 / App.js
Last active Apr 13, 2020
Notes before I blog about it: how-to-use-actioncable-and-npm-action-cable
View App.js
import React, { Component } from 'react';
import ActionCable from 'actioncable';
class App extends Component {
componentWillMount() {
var cable = ActionCable.createConsumer('ws://localhost:3000/cable')
@jwo
jwo / action.html.erb
Last active Apr 19, 2020
register React component on page with turbolinks working. The Rails parts (helper and ERB) are optional, but since this IS turbolinks, you probably ARE using rails.
View action.html.erb
<h1>Oh Hai</h1>
<%= react_component 'oh-hai' %>
@jwo
jwo / index.html
Created Jun 20, 2016
http://locationiq.org seems pretty great for Geocoding and reverse geo-coding. * And it works in standard jquery across domains, so it’ won’t trip up people with CORS. * Can work in simple server side queries as well for the same reason * Reverse geocoding works too though not as a replacement for foursquare places. Good for city/state tho. * I…
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@jwo
jwo / extra-credit.md
Created Mar 2, 2016
Extra Credit in TIY Backend Engineering
View extra-credit.md