Skip to content

Instantly share code, notes, and snippets.

View joelhelbling's full-sized avatar
💭
Perfect love casts out fear.

Joel Helbling joelhelbling

💭
Perfect love casts out fear.
View GitHub Profile

My Git Workflow Commands

I usually like to start by ensuring I've fetched everything new:

git fetch origin

I like to keep main up to date:

git co main && git pull

When I create a feature branch, I start from main:

git co main && git co -b my-new-feature

@joelhelbling
joelhelbling / roman_numerals_kata.rb
Created April 25, 2010 00:08
My implementation of the roman numerals kata (just the roman to arabic part).
# (Roman to Arabic only)
class RomanNumerals
def initialize
@numerals = {
"I" => 1,
"V" => 5,
"X" => 10,
"L" => 50,
"C" => 100,

ContinuousContext

A privacy-first, end-to-end encrypted system which presents context analysis for your everyday life. It can collect, collate and retrieve data from disparate sources and present tunable analysis to help you identify trends, habits and areas to target for improvement. It can also be used to assist with context recall, such as when you get Slack question about that thing you worked on with someone, way back when.

Now, for the naming of the parts.

local fill_inv
fill_inv = function()
for i = 1, 16 do
turtle.select(i)
turtle.suck()
end
end
local dump_inv
dump_inv = function()
for i = 1, 16 do
local slot_switch
slot_switch = function()
if turtle.getSelectedSlot() == 16 then
return turtle.select(1)
else
return turtle.select(turtle.getSelectedSlot() + 1)
end
end
local slot_check
slot_check = function()
@joelhelbling
joelhelbling / mock_server_example.rb
Created October 17, 2012 17:16
mock server in a separate thread
require 'goliath'
require 'open-uri'
class Hello < Goliath::API
@@say = "Hello World"
# silly mechanism for changing
# server's response
def self.say(something)
@@say = something
@joelhelbling
joelhelbling / cheap_gas_calculator_kata.txt
Created February 9, 2012 19:38
Cheap Gas Calculator
= Cheap Gas Calculator =
_Is it cheaper to drive across town for cheaper gas prices?_
== Givens / Assumptions ==
* Given: a particular car with its
** hwy MPG,
** tank size and
** current amount of fuel in gallons
* Given: a set of available gas stations with their
module NavigationHelpers
# Maps a name to a path. Used by the
#
# When /^I go to (.+)$/ do |page_name|
#
# step definition in webrat_steps.rb
#
def path_to(page_name)
case page_name
Given /^there is a document titled "([^\"]*)"$/ do |title|
Document.create!(:title => title, :body => 'Some content.')
end
When /^I visit the "([^\"]*)" document page$/ do |title|
visit "/documents/#{title}"
end
Feature: Wiki Documents
In order to manage wiki content
As a user
I want see, create and edit wiki documents
#
Scenario: View document page
Given there is a document titled "TestDocument"
When I visit the "TestDocument" document page
Then I should see "TestDocument"