Skip to content

Instantly share code, notes, and snippets.

@sowasred2012
sowasred2012 / README.txt
Last active August 29, 2015 13:56
Made Code Dojo 1: Roman Numeral Kata
FAILED
http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata
Notes (cos I had to look up what Prime Factors were):
=====================================================
http://en.wikipedia.org/wiki/Prime_factor
Prime factors of a number are the prime numbers you would multiply together to get that original number as a result, e.g:
@sowasred2012
sowasred2012 / README.txt
Last active August 29, 2015 13:57
Made Code Dojo 2: Pangrams
SUCCESS
## http://en.wikipedia.org/wiki/Pangram
Pangrams (also known as holoalphabetic sentences) are sentences in which every letter of the alphabet is featured at least once.
Write a script that will take a string and return true or false depending on whether that string is a pangram, as well a tally count for each letter of the alphabet.
Pangram examples:
@sowasred2012
sowasred2012 / README.txt
Created April 16, 2014 10:43
Made Code Dojo 3: Even Fibonacci Number
FAILED
http://projecteuler.net/problem=2
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
@sowasred2012
sowasred2012 / PalindromeProduct.js
Created April 16, 2014 10:46
Made Code Dojo 4: Palindromic Numbers
function Palindrome () { };
Palindrome.prototype.isPalindrome = function (candidate) {
reversedCandidate = candidate.toString().split("").reverse().join("");
return candidate.toString() == reversedCandidate;
};
Palindrome.prototype.product = function (number1, number2) {
return number1 * number2;
@sowasred2012
sowasred2012 / README.txt
Created May 21, 2014 14:29
NumberLetterCounts Kata (Project Euler)
If the numbers 1 to 5 are written out in words: one, two, three, four, five
then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE:
Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
Rock Paper Scissors Lizard Spock is a more convoluted and much geekier version of Rock Paper Scissors.
The rules are:
Rock beats Scissors
Rock crushes Lizard
Paper covers Rock
Paper disproves Spock
Scissors cut Paper
Scissors decapitate Lizard
@sowasred2012
sowasred2012 / timekeepsonslippin.sh
Created June 23, 2014 09:59
Vagrant time slippage
# time in Vagrant seems to fall out of sync fairly often (albeit very slowly)
# and can fuck with some oauth requests - this syncs it back up:
sudo ntpdate pool.ntp.org
  • Invite Supply Chain Users
    • demonstrate that an invited contact associated with a member authority is given access to the supply chain member dashboard, and sees only their company's data
  • Adding a User
  • Regional Help for Cities
  • Demo expandable guidance doc block
  • Demo webinar calendars and Programme calendars
    • including different colours for supply chain/cities
  • Supply Chain custom search block
  • Supply Chain specific help block
  • Tweaks to search results page?
Spree::Order.prepend(Kjus::Order)
Spree::Order.class_eval do
attr_accessor :use_shipping
before_validation :clone_shipping_address, if: :use_shipping?
def use_shipping?
@use_shipping == true || @use_shipping == 'true' || @use_shipping == '1'
end