repo
string
commit
string
message
string
diff
string
kerryb/real-world-haskell
b934331367c15deafc3a4354f11d5d6b2f9a7321
Chapter 4 part 1 exercise 4
diff --git a/.gitignore b/.gitignore index 3013aaf..ffe8ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.hi *.o ch4/Interact ch4/FixLines ch4/part1/ex3/FirstLines +ch4/part1/ex4/Transpose diff --git a/ch4/part1/ex4/Transpose.hs b/ch4/part1/ex4/Transpose.hs new file mode 100644 index 0000000..cd984aa --- /dev/null +++ b/ch4/part1/ex4/Transpose.hs @@ -0,0 +1,28 @@ +import System.Environment (getArgs) + +interactWith function inputFile outputFile = do + input <- readFile inputFile + writeFile outputFile (function input) + +main = mainWith myFunction + where mainWith function = do + args <- getArgs + case args of + [input,output] -> interactWith function input output + _ -> putStrLn "error: exactly two arguments needed" + + myFunction = transpose + +transpose :: String -> String +transpose s = unlines transposedLines + where transposedLines = reverse (fst (transposeLines ([], lines s))) + +transposeLines :: ([String], [String]) -> ([String], [String]) +transposeLines (news, olds) | all null olds = (news, []) + | otherwise = transposeLines (next_news, next_olds) + where next_news = (map head_or_empty olds) : news + next_olds = map tail_or_empty olds + head_or_empty x | null x = ' ' + | otherwise = head x + tail_or_empty x | null x = "" + | otherwise = tail x
kerryb/real-world-haskell
0f467a2ee741df7c6f3f3f354689553da0f98fb0
Chapter 4 part 1 exercise 3
diff --git a/.gitignore b/.gitignore index 8a40bc5..3013aaf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -**/*.hi -**/*.o +*.hi +*.o ch4/Interact ch4/FixLines +ch4/part1/ex3/FirstLines diff --git a/ch4/part1/ex3/FirstLines.hs b/ch4/part1/ex3/FirstLines.hs new file mode 100644 index 0000000..1ff7e48 --- /dev/null +++ b/ch4/part1/ex3/FirstLines.hs @@ -0,0 +1,19 @@ +import System.Environment (getArgs) + +interactWith function inputFile outputFile = do + input <- readFile inputFile + writeFile outputFile (function input) + +main = mainWith myFunction + where mainWith function = do + args <- getArgs + case args of + [input,output] -> interactWith function input output + _ -> putStrLn "error: exactly two arguments needed" + + myFunction = firstLines + +firstLines s = unlines firstWords + where firstWords = map firstWord (lines s) + firstWord s | null s = "" + | otherwise = head (words s)
kerryb/real-world-haskell
b88fb57e8781f8ac7fa5e41c2d9e25787f2c7b32
Chapter 4 part 1 exercise 2
diff --git a/ch4/part1/ex2/SplitWith.hs b/ch4/part1/ex2/SplitWith.hs new file mode 100644 index 0000000..6972053 --- /dev/null +++ b/ch4/part1/ex2/SplitWith.hs @@ -0,0 +1,6 @@ +splitWith :: (a -> Bool) -> [a] -> [[a]] +splitWith _ [] = [] +splitWith fn xs | null before = splitWith fn (tail after) + | null after = [before] + | otherwise = before : splitWith fn (tail after) + where (before, after) = span fn xs
kerryb/real-world-haskell
efb89386915c6e748789672547132ae9b1572ee6
Chapter 4 part 1 exercise 1
diff --git a/ch4/part1/ex1/SafeListFunctions.hs b/ch4/part1/ex1/SafeListFunctions.hs new file mode 100644 index 0000000..db393dd --- /dev/null +++ b/ch4/part1/ex1/SafeListFunctions.hs @@ -0,0 +1,11 @@ +safeHead [] = Nothing +safeHead xs = Just (head xs) + +safeTail [] = Nothing +safeTail xs = Just (tail xs) + +safeLast [] = Nothing +safeLast xs = Just (last xs) + +safeInit [] = Nothing +safeInit xs = Just (init xs)
kerryb/real-world-haskell
20e72745af851c78586e4b3caf57e5874ba4667b
Add FixLines
diff --git a/.gitignore b/.gitignore index a6dc9f1..8a40bc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/*.hi **/*.o ch4/Interact +ch4/FixLines diff --git a/ch4/FixLines.hs b/ch4/FixLines.hs index b2f628e..16e466d 100644 --- a/ch4/FixLines.hs +++ b/ch4/FixLines.hs @@ -1,29 +1,29 @@ import System.Environment (getArgs) interactWith function inputFile outputFile = do input <- readFile inputFile writeFile outputFile (function input) splitLines [] = [] splitLines cs = let (pre, suf) = break isLineTerminator cs in pre : case suf of ('\r':'\n':rest) -> splitLines rest ('\r':rest) -> splitLines rest ('\n':rest) -> splitLines rest _ -> [] isLineTerminator c = c == '\r' || c == '\n' fixLines :: String -> String fixLines input = unlines (splitLines input) main = mainWith myFunction where mainWith function = do args <- getArgs case args of [input,output] -> interactWith function input output _ -> putStrLn "error: exactly two arguments needed" -- replace "id" with the name of our function below - myFunction = id + myFunction = fixLines
kerryb/real-world-haskell
009808bdf4cee55c5e23a239342a1b47b5ece6e0
Add Interact program
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a6dc9f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/*.hi +**/*.o +ch4/Interact diff --git a/ch4/FixLines.hs b/ch4/FixLines.hs new file mode 100644 index 0000000..b2f628e --- /dev/null +++ b/ch4/FixLines.hs @@ -0,0 +1,29 @@ +import System.Environment (getArgs) + +interactWith function inputFile outputFile = do + input <- readFile inputFile + writeFile outputFile (function input) + +splitLines [] = [] +splitLines cs = + let (pre, suf) = break isLineTerminator cs + in pre : case suf of + ('\r':'\n':rest) -> splitLines rest + ('\r':rest) -> splitLines rest + ('\n':rest) -> splitLines rest + _ -> [] + +isLineTerminator c = c == '\r' || c == '\n' + +fixLines :: String -> String +fixLines input = unlines (splitLines input) + +main = mainWith myFunction + where mainWith function = do + args <- getArgs + case args of + [input,output] -> interactWith function input output + _ -> putStrLn "error: exactly two arguments needed" + + -- replace "id" with the name of our function below + myFunction = id diff --git a/ch4/Interact.hs b/ch4/Interact.hs new file mode 100644 index 0000000..66e40ef --- /dev/null +++ b/ch4/Interact.hs @@ -0,0 +1,15 @@ +import System.Environment (getArgs) + +interactWith function inputFile outputFile = do + input <- readFile inputFile + writeFile outputFile (function input) + +main = mainWith myFunction + where mainWith function = do + args <- getArgs + case args of + [input,output] -> interactWith function input output + _ -> putStrLn "error: exactly two arguments needed" + + -- replace "id" with the name of our function below + myFunction = id
kerryb/real-world-haskell
624eb9e39e0ad4b74131089cf240d525bdff731f
Return [Direction], not String (what was I thinking?)
diff --git a/ch3/part2/ex11/Direction.hs b/ch3/part2/ex11/Direction.hs index d787e4b..4e417cc 100644 --- a/ch3/part2/ex11/Direction.hs +++ b/ch3/part2/ex11/Direction.hs @@ -1,21 +1,21 @@ data Direction = RightTurn | LeftTurn | StraightLine deriving (Show) data CartesianPoint = CartesianPoint {x::Int, y::Int} deriving (Show) -- See http://en.wikipedia.org/wiki/Graham_scan#Algorithm turnDirection a b c | crossProductSign < 0 = RightTurn | crossProductSign > 0 = LeftTurn | otherwise = StraightLine where line1_x = x b - x a line1_y = y b - y a overall_x = x c - x a overall_y = y c - y a crossProductSign = line1_x * overall_y - line1_y * overall_x -turnDirections [] = "" -turnDirections [_] = "" -turnDirections [_,_] = "" -turnDirections (a:b:c:xs) = show (turnDirection a b c) ++ " " ++ turnDirections (b:c:xs) +turnDirections [] = [] +turnDirections [_] = [] +turnDirections [_,_] = [] +turnDirections (a:b:c:xs) = turnDirection a b c : turnDirections (b:c:xs)
kerryb/real-world-haskell
65400333729d5c2fcd10da2bd36e41125af1ee37
Chapter 3 part 2 exercise 11
diff --git a/ch3/part2/ex11/Direction.hs b/ch3/part2/ex11/Direction.hs new file mode 100644 index 0000000..d787e4b --- /dev/null +++ b/ch3/part2/ex11/Direction.hs @@ -0,0 +1,21 @@ +data Direction = RightTurn | LeftTurn | StraightLine + deriving (Show) + +data CartesianPoint = CartesianPoint {x::Int, y::Int} + deriving (Show) + +-- See http://en.wikipedia.org/wiki/Graham_scan#Algorithm +turnDirection a b c + | crossProductSign < 0 = RightTurn + | crossProductSign > 0 = LeftTurn + | otherwise = StraightLine + where line1_x = x b - x a + line1_y = y b - y a + overall_x = x c - x a + overall_y = y c - y a + crossProductSign = line1_x * overall_y - line1_y * overall_x + +turnDirections [] = "" +turnDirections [_] = "" +turnDirections [_,_] = "" +turnDirections (a:b:c:xs) = show (turnDirection a b c) ++ " " ++ turnDirections (b:c:xs)
kerryb/real-world-haskell
960839a3efe7d94c457e82a55ac895da4e8b8684
Chapter 3 part 2 exercise 10
diff --git a/ch3/part2/ex10/Direction.hs b/ch3/part2/ex10/Direction.hs new file mode 100644 index 0000000..22fc416 --- /dev/null +++ b/ch3/part2/ex10/Direction.hs @@ -0,0 +1,16 @@ +data Direction = RightTurn | LeftTurn | StraightLine + deriving (Show) + +data CartesianPoint = CartesianPoint {x::Int, y::Int} + deriving (Show) + +-- See http://en.wikipedia.org/wiki/Graham_scan#Algorithm +turnDirection a b c + | crossProductSign < 0 = RightTurn + | crossProductSign > 0 = LeftTurn + | otherwise = StraightLine + where line1_x = x b - x a + line1_y = y b - y a + overall_x = x c - x a + overall_y = y c - y a + crossProductSign = line1_x * overall_y - line1_y * overall_x
kerryb/real-world-haskell
491f2586aa8abfa251b48f591f5dd9bd4b314192
Chapter 3 part 2 exercise 9
diff --git a/ch3/part2/ex9/Direction.hs b/ch3/part2/ex9/Direction.hs new file mode 100644 index 0000000..e260c91 --- /dev/null +++ b/ch3/part2/ex9/Direction.hs @@ -0,0 +1,2 @@ +data Direction = RightTurn | LeftTurn | StraightLine + deriving (Show)
kerryb/real-world-haskell
5371e4071277505db1c386db8c7f7771659bb747
Chapter 3 part 2 exercise 8
diff --git a/ch3/part2/ex8/Tree.hs b/ch3/part2/ex8/Tree.hs new file mode 100644 index 0000000..4d0b374 --- /dev/null +++ b/ch3/part2/ex8/Tree.hs @@ -0,0 +1,14 @@ +data Tree a = Node a (Tree a) (Tree a) + | Empty + deriving (Show) + +depth Empty = 0 +depth (Node _ left right) = 1 + max (depth left) (depth right) + +-- test data +depth0Tree = Empty +depth1Tree = Node "parent" Empty Empty +depth2Tree = Node "parent" (Node "left child" Empty Empty) + (Node "right child" Empty Empty) +depth3Tree = Node "parent" (Node "left child" Empty Empty) + (Node "right child" (Node "grandchild" Empty Empty) Empty)
kerryb/real-world-haskell
3c9e070690636600118d698631af4861bc2324f9
Chapter 3 part 2 exercise 7
diff --git a/ch3/part2/ex7/Intersperse.hs b/ch3/part2/ex7/Intersperse.hs new file mode 100644 index 0000000..ca251c7 --- /dev/null +++ b/ch3/part2/ex7/Intersperse.hs @@ -0,0 +1,4 @@ +intersperse :: a -> [[a]] -> [a] +intersperse _ [] = [] +intersperse _ [x] = x +intersperse seperator (x:xs) = x ++ seperator : (intersperse seperator xs)
kerryb/real-world-haskell
1862577ef608fbe8b1adfd21b9d900993e7891ff
Chapter 3 part 2 exercise 6
diff --git a/ch3/part2/ex6/SortByLength.hs b/ch3/part2/ex6/SortByLength.hs new file mode 100644 index 0000000..4d6a9e2 --- /dev/null +++ b/ch3/part2/ex6/SortByLength.hs @@ -0,0 +1,4 @@ +import Data.List + +compareLengths a b = compare (length a) (length b) +sortByLength lists = sortBy compareLengths lists
kerryb/real-world-haskell
374bd7b46e8cffec8faaa6d128c846426f9c6a95
Tidy indentation
diff --git a/ch3/part2/ex4/Palindrome.hs b/ch3/part2/ex4/Palindrome.hs index 7599b89..5b67449 100644 --- a/ch3/part2/ex4/Palindrome.hs +++ b/ch3/part2/ex4/Palindrome.hs @@ -1,4 +1,4 @@ -palindrome [] = [] -palindrome [a] = [a] -palindrome [a,b] = [a,b,a] +palindrome [] = [] +palindrome [a] = [a] +palindrome [a,b] = [a,b,a] palindrome (a:bs) = a : (palindrome bs) ++ [a] diff --git a/ch3/part2/ex5/IsPalindrome.hs b/ch3/part2/ex5/IsPalindrome.hs index fc90eca..4ed28be 100644 --- a/ch3/part2/ex5/IsPalindrome.hs +++ b/ch3/part2/ex5/IsPalindrome.hs @@ -1,4 +1,4 @@ -isPalindrome [] = True +isPalindrome [] = True isPalindrome [_] = True -isPalindrome xs = (head xs == last xs) && (isPalindrome middle) - where middle = drop 1 (init xs) +isPalindrome xs = (head xs == last xs) && (isPalindrome middle) + where middle = drop 1 (init xs)
kerryb/real-world-haskell
9a13d73e358e0d17a6a3d93561e346b6011ae8bd
Chapter 3 part 2 exercise 5
diff --git a/ch3/part2/ex5/IsPalindrome.hs b/ch3/part2/ex5/IsPalindrome.hs new file mode 100644 index 0000000..fc90eca --- /dev/null +++ b/ch3/part2/ex5/IsPalindrome.hs @@ -0,0 +1,4 @@ +isPalindrome [] = True +isPalindrome [_] = True +isPalindrome xs = (head xs == last xs) && (isPalindrome middle) + where middle = drop 1 (init xs)
kerryb/real-world-haskell
307a7242826263851e5dca905364070f4945f864
Chapter 3 part 2 exercise 4
diff --git a/ch3/part2/ex4/Palindrome.hs b/ch3/part2/ex4/Palindrome.hs new file mode 100644 index 0000000..7599b89 --- /dev/null +++ b/ch3/part2/ex4/Palindrome.hs @@ -0,0 +1,4 @@ +palindrome [] = [] +palindrome [a] = [a] +palindrome [a,b] = [a,b,a] +palindrome (a:bs) = a : (palindrome bs) ++ [a]
kerryb/real-world-haskell
6a47043304afd887316229121d52739586895f36
Calculate mean from scratch (no lib fns)
diff --git a/ch3/part2/ex3/Mean.hs b/ch3/part2/ex3/Mean.hs index a9f6a75..73053da 100644 --- a/ch3/part2/ex3/Mean.hs +++ b/ch3/part2/ex3/Mean.hs @@ -1,2 +1,8 @@ -mean xs = (sum xs) / (fromIntegral (length xs)) +mySum [] = 0 +mySum (x:xs) = x + (mySum xs) + +myLength [] = 0 +myLength (_:xs) = 1 + (myLength xs) + +mean xs = (mySum xs) / (fromIntegral (myLength xs))
kerryb/real-world-haskell
6298c203b6d422f88037cd6be9b2aab0481633d3
Chapter 3 part 2 exercise 3
diff --git a/ch3/part2/ex3/Mean.hs b/ch3/part2/ex3/Mean.hs new file mode 100644 index 0000000..a9f6a75 --- /dev/null +++ b/ch3/part2/ex3/Mean.hs @@ -0,0 +1,2 @@ +mean xs = (sum xs) / (fromIntegral (length xs)) +
kerryb/real-world-haskell
05c5fb6b437e61ffc173c7dd1681c378ad8e0019
Adjust indents
diff --git a/ch3/part2/ex1/ListLength.hs b/ch3/part2/ex1/ListLength.hs index af7808e..94e9f1a 100644 --- a/ch3/part2/ex1/ListLength.hs +++ b/ch3/part2/ex1/ListLength.hs @@ -1,3 +1,3 @@ -listLength [] = 0 -listLength [_] = 1 +listLength [] = 0 +listLength [_] = 1 listLength (_:xs) = 1 + (listLength xs) diff --git a/ch3/part2/ex2/ListLength.hs b/ch3/part2/ex2/ListLength.hs index 78adad0..84a7626 100644 --- a/ch3/part2/ex2/ListLength.hs +++ b/ch3/part2/ex2/ListLength.hs @@ -1,4 +1,4 @@ listLength :: [a] -> Int -listLength [] = 0 -listLength [_] = 1 +listLength [] = 0 +listLength [_] = 1 listLength (_:xs) = 1 + (listLength xs)
kerryb/real-world-haskell
577c22028d82c580e13e33f699ee9c71f49091de
Chapter 3 part 2 exercise 2
diff --git a/ch3/part2/ex2/ListLength.hs b/ch3/part2/ex2/ListLength.hs new file mode 100644 index 0000000..78adad0 --- /dev/null +++ b/ch3/part2/ex2/ListLength.hs @@ -0,0 +1,4 @@ +listLength :: [a] -> Int +listLength [] = 0 +listLength [_] = 1 +listLength (_:xs) = 1 + (listLength xs)
kerryb/real-world-haskell
84606eeac4c7dbe0e6250d7c519ea5dc6ef6aef4
Chapter 3 part 2 exercise 1
diff --git a/ch3/part2/ex1/ListLength.hs b/ch3/part2/ex1/ListLength.hs new file mode 100644 index 0000000..af7808e --- /dev/null +++ b/ch3/part2/ex1/ListLength.hs @@ -0,0 +1,3 @@ +listLength [] = 0 +listLength [_] = 1 +listLength (_:xs) = 1 + (listLength xs)
kerryb/real-world-haskell
5422b7b6f296db1841212284dada635645c003cb
Chapter 3 part 1 exercise 2
diff --git a/ch3/part1/ex2/Tree.hs b/ch3/part1/ex2/Tree.hs new file mode 100644 index 0000000..5f58bc6 --- /dev/null +++ b/ch3/part1/ex2/Tree.hs @@ -0,0 +1,6 @@ +data Tree a = Node a (Maybe (Tree a)) (Maybe (Tree a)) + deriving (Show) + +simpleTree = (Node "parent") + (Just ((Node "left child") Nothing Nothing)) + (Just ((Node "right child") Nothing Nothing))
kerryb/real-world-haskell
df0d513c23535f7304dd235d6696cb94a8d84111
Chapter 1 part 1 exercise 1
diff --git a/ch3/ex_a1/ListADT.hs b/ch3/ex_a1/ListADT.hs new file mode 100644 index 0000000..1d970d1 --- /dev/null +++ b/ch3/ex_a1/ListADT.hs @@ -0,0 +1,6 @@ +data List a = Cons a (List a) + | Nil + deriving (Show) + +toList (x:xs) = Cons x (toList xs) +toList [] = Nil
kerryb/real-world-haskell
7588161073291d238295459a106189349831b560
Exercises for chapter 2
diff --git a/ch2/ex_a1.txt b/ch2/ex_a1.txt new file mode 100644 index 0000000..3fc8891 --- /dev/null +++ b/ch2/ex_a1.txt @@ -0,0 +1,3 @@ +False :: Bool +(["foo", "bar"], 'a') :: ([[Char]], Char) +[(True, []), (False, [['a']])] :: [(Bool, [[Char]])] diff --git a/ch2/ex_b1.txt b/ch2/ex_b1.txt new file mode 100644 index 0000000..ea81362 --- /dev/null +++ b/ch2/ex_b1.txt @@ -0,0 +1,6 @@ +"last :: [a] -> a" could... + +* Return the last element +* Return the first element +* Return the nth element (for some constant n) +* Return the element at some random position (eg the middle) diff --git a/ch2/ex_b3.txt b/ch2/ex_b3.txt new file mode 100644 index 0000000..822ee12 --- /dev/null +++ b/ch2/ex_b3.txt @@ -0,0 +1,10 @@ +ghc> lastButOne [1, 2, 3, 4] +3 +ghc> lastButOne [1, 2, 3] +2 +ghc> lastButOne [1, 2] +1 +ghc> lastButOne [1] +*** Exception: Prelude.last: empty list +ghc> lastButOne [] +*** Exception: Prelude.init: empty list diff --git a/ch2/ex_b3/LastButOne.hs b/ch2/ex_b3/LastButOne.hs new file mode 100644 index 0000000..bff12a1 --- /dev/null +++ b/ch2/ex_b3/LastButOne.hs @@ -0,0 +1 @@ +lastButOne a = last (init a)
kerryb/real-world-haskell
eb07638b199f274acf2d9008835dda4edd0edec2
Chapter 1 Exercise 4
diff --git a/ch1/ex4/WC.hs b/ch1/ex4/WC.hs new file mode 100644 index 0000000..086cfa6 --- /dev/null +++ b/ch1/ex4/WC.hs @@ -0,0 +1,4 @@ +main = interact wordCount + where wordCount input = show (length (lines input)) ++ "\t" + ++ show (length (words input)) ++ "\t" + ++ show (length input) ++ "\n" diff --git a/ch1/ex4/quux.txt b/ch1/ex4/quux.txt new file mode 100644 index 0000000..2f45fdf --- /dev/null +++ b/ch1/ex4/quux.txt @@ -0,0 +1,7 @@ +Teignmouth, England +Paris, France +Ulm, Germany +Auxerre, France +Brunswick, Germany +Beaumont-en-Auge, France +Ryazan, Russia
kerryb/real-world-haskell
bf546369563fc76ea22a86b24a500999e5a4eb49
Chapter 1 Exercise 3
diff --git a/ch1/ex3/WC.hs b/ch1/ex3/WC.hs new file mode 100644 index 0000000..2dc59d9 --- /dev/null +++ b/ch1/ex3/WC.hs @@ -0,0 +1,2 @@ +main = interact wordCount + where wordCount input = show (length (words input)) ++ "\n" diff --git a/ch1/ex3/quux.txt b/ch1/ex3/quux.txt new file mode 100644 index 0000000..2f45fdf --- /dev/null +++ b/ch1/ex3/quux.txt @@ -0,0 +1,7 @@ +Teignmouth, England +Paris, France +Ulm, Germany +Auxerre, France +Brunswick, Germany +Beaumont-en-Auge, France +Ryazan, Russia
kerryb/real-world-haskell
b46c3fdc2fb293f071467ea405c3c6e266ea4400
Chapter 1 Exercise 2
diff --git a/ch1/ex2.txt b/ch1/ex2.txt new file mode 100644 index 0000000..f6715fb --- /dev/null +++ b/ch1/ex2.txt @@ -0,0 +1,3 @@ +ghc> let x = 1 +ghc> :show bindings +x :: Integer = _
kerryb/real-world-haskell
87a021cf3b8766aa1ad198d4b305368417642e2e
Chapter 1 Exercise 1
diff --git a/ch1/ex1.txt b/ch1/ex1.txt new file mode 100644 index 0000000..d9db90b --- /dev/null +++ b/ch1/ex1.txt @@ -0,0 +1,15 @@ +5 + 8 :: (Num t) => t +3 * 5 + 8 :: (Num t) => t +2 + 4 :: (Num t) => t +(+) 2 4 :: (Num t) => t +sqrt 16 :: (Floating t) => t +succ 6 :: (Num t, Enum t) => t +succ 7 :: (Num t, Enum t) => t +pred 9 :: (Num t, Enum t) => t +pred 8 :: (Num t, Enum t) => t +sin (pi / 2) :: (Floating a) => a +truncate pi :: (Integral b) => b +round 3.5 :: (Integral b) => b +round 3.4 :: (Integral b) => b +floor 3.7 :: (Integral b) => b +ceiling 3.3 :: (Integral b) => b
EEHarbor/low_random
892b6dae8282b159e580e3c1a6076a39d9902f84
changelog version 4.1.1
diff --git a/CHANGELOG.md b/CHANGELOG.md index d0a8d5b..20a33d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,67 +1,72 @@ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [4.1.1] - 2023-03-23 +### Fixed +- Foundation Bug + ## [4.1.0] - 2023-03-18 ### Changed - Update Foundation Version - Start PHP 8.2 Compatibility ## [4.0.2] - 2022-09-27 - Verified ExpressionEngine 7 Compatibility ## [4.0.1] - 2021-11-18 ### Changed - Updated EEHarbor Foundation to fix issue with multiple add-ons ignoring MSM sites - Updated for PSR-12 compatibility (custom ruleset) - Updated for PHP 8 compatibility ## [4.0.0] - 2021-02-25 ### Added - EE5 & EE6 Compatibility ## [3.0.0] - 2017-12-25 ### Added - EE3 & EE4 Compatibility ## [2.3.0] - 2015-07-08 ### Added - Support for config overrides for upload destinations ## [2.2.0] - 2013-06-06 ### Added - EE 2.6 compatiblity - PHP 5.6 compatiblity ## [2.1.0] - 2009-12-09 ### Added - `exp:low_random:items` tag pair ## [2.0.0] - 2009-11-25 ### Added - EE 2 compatiblity ## [1.1.0] - 2009-11-09 ### Added - `exp:low_random:items` tag pair ## 1.0.0 - 2009-01-07 ### Added - First Release! -[Unreleased]: https://github.com/packettide/wygwam/compare/v4.1.0...HEAD +[Unreleased]: https://github.com/packettide/wygwam/compare/v4.1.1...HEAD +[4.1.1]: https://github.com/packettide/wygwam/compare/v4.1.0...v4.1.1 [4.1.0]: https://github.com/packettide/wygwam/compare/v4.0.2...v4.1.0 [4.0.2]: https://github.com/packettide/wygwam/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/packettide/wygwam/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/packettide/wygwam/compare/v3.0.0...v4.0.0 [3.0.0]: https://github.com/packettide/wygwam/compare/v2.3.0...v3.0.0 [2.3.0]: https://github.com/packettide/wygwam/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/packettide/wygwam/compare/v2.1.0...v2.2.0 [2.1.0]: https://github.com/packettide/wygwam/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/packettide/wygwam/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/packettide/wygwam/compare/v1.0.0...v1.1.0 \ No newline at end of file diff --git a/low_random/addon.json b/low_random/addon.json index 18749cb..63d6fd9 100644 --- a/low_random/addon.json +++ b/low_random/addon.json @@ -1,16 +1,16 @@ { "name": "Low Random", "shortname": "low_random", - "version": "4.1.0", + "version": "4.1.1", "foundation_version": "4.10.0", "description": "Generates randomness", "license": "EEHarbor", "namespace": "Low\\Random", "require": { "php": ">=5.6.*", "expressionengine/core": ">=3" }, "resources": { } } \ No newline at end of file
EEHarbor/low_random
9a1d228cd574809b1ea2477456911793dd9ad303
added new phar
diff --git a/low_random/low_random.phar b/low_random/low_random.phar index 37b3213..c9f1c0c 100644 Binary files a/low_random/low_random.phar and b/low_random/low_random.phar differ
EEHarbor/low_random
a076658f0b1ec035299a033b0d10bb40de92986d
version bump and changelog
diff --git a/CHANGELOG.md b/CHANGELOG.md index 107b7f2..d0a8d5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,60 +1,67 @@ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [4.1.0] - 2023-03-18 +### Changed +- Update Foundation Version +- Start PHP 8.2 Compatibility + ## [4.0.2] - 2022-09-27 - Verified ExpressionEngine 7 Compatibility ## [4.0.1] - 2021-11-18 ### Changed - Updated EEHarbor Foundation to fix issue with multiple add-ons ignoring MSM sites - Updated for PSR-12 compatibility (custom ruleset) - Updated for PHP 8 compatibility ## [4.0.0] - 2021-02-25 ### Added - EE5 & EE6 Compatibility ## [3.0.0] - 2017-12-25 ### Added - EE3 & EE4 Compatibility ## [2.3.0] - 2015-07-08 ### Added - Support for config overrides for upload destinations ## [2.2.0] - 2013-06-06 ### Added - EE 2.6 compatiblity - PHP 5.6 compatiblity ## [2.1.0] - 2009-12-09 ### Added - `exp:low_random:items` tag pair ## [2.0.0] - 2009-11-25 ### Added - EE 2 compatiblity ## [1.1.0] - 2009-11-09 ### Added - `exp:low_random:items` tag pair ## 1.0.0 - 2009-01-07 ### Added - First Release! -[Unreleased]: https://github.com/packettide/wygwam/compare/v4.0.2...HEAD +[Unreleased]: https://github.com/packettide/wygwam/compare/v4.1.0...HEAD +[4.1.0]: https://github.com/packettide/wygwam/compare/v4.0.2...v4.1.0 [4.0.2]: https://github.com/packettide/wygwam/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/packettide/wygwam/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/packettide/wygwam/compare/v3.0.0...v4.0.0 [3.0.0]: https://github.com/packettide/wygwam/compare/v2.3.0...v3.0.0 [2.3.0]: https://github.com/packettide/wygwam/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/packettide/wygwam/compare/v2.1.0...v2.2.0 [2.1.0]: https://github.com/packettide/wygwam/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/packettide/wygwam/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/packettide/wygwam/compare/v1.0.0...v1.1.0 \ No newline at end of file diff --git a/low_random/addon.json b/low_random/addon.json index 6c68824..18749cb 100644 --- a/low_random/addon.json +++ b/low_random/addon.json @@ -1,16 +1,16 @@ { "name": "Low Random", "shortname": "low_random", - "version": "4.0.2", + "version": "4.1.0", "foundation_version": "4.10.0", "description": "Generates randomness", "license": "EEHarbor", "namespace": "Low\\Random", "require": { "php": ">=5.6.*", "expressionengine/core": ">=3" }, "resources": { } } \ No newline at end of file
EEHarbor/low_random
9c24d1386e529e792459dd0f60430e5736713d7a
foundational updates
diff --git a/low_random/low_random.phar b/low_random/low_random.phar index 74ebba6..37b3213 100644 Binary files a/low_random/low_random.phar and b/low_random/low_random.phar differ
EEHarbor/low_random
fcde8876a8e36e05852d054c29089cac6d40287a
bumped version for ee7 support
diff --git a/CHANGELOG.md b/CHANGELOG.md index 22659a8..107b7f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,57 +1,60 @@ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [4.0.2] - 2022-09-27 +- Verified ExpressionEngine 7 Compatibility ## [4.0.1] - 2021-11-18 ### Changed - Updated EEHarbor Foundation to fix issue with multiple add-ons ignoring MSM sites - Updated for PSR-12 compatibility (custom ruleset) - Updated for PHP 8 compatibility ## [4.0.0] - 2021-02-25 ### Added - EE5 & EE6 Compatibility ## [3.0.0] - 2017-12-25 ### Added - EE3 & EE4 Compatibility ## [2.3.0] - 2015-07-08 ### Added - Support for config overrides for upload destinations ## [2.2.0] - 2013-06-06 ### Added - EE 2.6 compatiblity - PHP 5.6 compatiblity ## [2.1.0] - 2009-12-09 ### Added - `exp:low_random:items` tag pair ## [2.0.0] - 2009-11-25 ### Added - EE 2 compatiblity ## [1.1.0] - 2009-11-09 ### Added - `exp:low_random:items` tag pair ## 1.0.0 - 2009-01-07 ### Added - First Release! -[Unreleased]: https://github.com/packettide/wygwam/compare/v4.0.1...HEAD +[Unreleased]: https://github.com/packettide/wygwam/compare/v4.0.2...HEAD +[4.0.2]: https://github.com/packettide/wygwam/compare/v4.0.1...v4.0.2 [4.0.1]: https://github.com/packettide/wygwam/compare/v4.0.0...v4.0.1 [4.0.0]: https://github.com/packettide/wygwam/compare/v3.0.0...v4.0.0 [3.0.0]: https://github.com/packettide/wygwam/compare/v2.3.0...v3.0.0 [2.3.0]: https://github.com/packettide/wygwam/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/packettide/wygwam/compare/v2.1.0...v2.2.0 [2.1.0]: https://github.com/packettide/wygwam/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/packettide/wygwam/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/packettide/wygwam/compare/v1.0.0...v1.1.0 \ No newline at end of file diff --git a/low_random/addon.json b/low_random/addon.json index 6e8f713..23061a1 100644 --- a/low_random/addon.json +++ b/low_random/addon.json @@ -1,16 +1,16 @@ { "name": "Low Random", "shortname": "low_random", - "version": "4.0.1", + "version": "4.0.2", "foundation_version": "4.9.0", "description": "Generates randomness", "license": "EEHarbor", "namespace": "Low\\Random", "require": { "php": ">=5.6.*", "expressionengine/core": ">=3" }, "resources": { } } \ No newline at end of file
EEHarbor/low_random
efd8cb99e7a2c5aa347b4113b8303ca39bed2c54
bug in src for tags
diff --git a/documentation/02.tags.html b/documentation/02.tags.html index 0832b56..d2b5f6a 100644 --- a/documentation/02.tags.html +++ b/documentation/02.tags.html @@ -1,10 +1,10 @@ --- title: Tag Reference --- <div id="vuedocs"> <addon-docs :docs="docs"></addon-docs> </div> -<script src="/doc_src/low_random/documentation/data/module_tags.js"></script> +<script src="/doc_src/low-random/documentation/data/module_tags.js"></script> <script src="/_assets/scripts/vue.js"></script>
EEHarbor/low_random
274c8c49000347d96ac0e829e64ddc2b446170a1
added docs
diff --git a/documentation/01.installation.html b/documentation/01.installation.html new file mode 100644 index 0000000..3d1f76d --- /dev/null +++ b/documentation/01.installation.html @@ -0,0 +1,13 @@ +--- +title: Installation +--- + +<h3>Compatibility</h3> +The download contains the version that is compatible with both the EE3 and EE4. Older versions are available on Github: EE2 and EE1. + +<h3>Installation</h3> +- Download and unzip the latest version of Low Random. +- Copy the low_random folder to your /system/user/addons directory. +- In your Control Panel, go to the Add-on Manager and install Low Random. +- All set! + diff --git a/documentation/02.tags.html b/documentation/02.tags.html new file mode 100644 index 0000000..0832b56 --- /dev/null +++ b/documentation/02.tags.html @@ -0,0 +1,10 @@ +--- +title: Tag Reference +--- +<div id="vuedocs"> + <addon-docs :docs="docs"></addon-docs> +</div> + +<script src="/doc_src/low_random/documentation/data/module_tags.js"></script> +<script src="/_assets/scripts/vue.js"></script> + diff --git a/documentation/data/module_tags.js b/documentation/data/module_tags.js new file mode 100644 index 0000000..5b9657f --- /dev/null +++ b/documentation/data/module_tags.js @@ -0,0 +1,249 @@ +window.doc_page = { + addon: 'Low Random', + title: 'Tags', + sections: [ + { + title: '', + type: 'tagtoc', + desc: 'Low Random has the following front-end tags: ', + }, + { + title: '', + type: 'tags', + desc: '' + }, + ], + tags: [ + { + tag: '{exp:low_random:file}', + shortname: 'exp:low_random:file', + summary: "", + desc: "", + sections: [ + { + type: 'params', + title: 'Tag Parameters', + desc: '', + items: [ + { + item: 'folder', + desc: ' Either the server path of the folder, or the numeric Upload Destination id. Required.', + type: '', + accepts: '', + default: '', + required: true, + added: '', + examples: [ + { + tag_example: `{exp:low_random:file folder="/some/path/to/images" filter="masthead|.jpg"}`, + outputs: `` + } + ] + }, + + { + item: 'filter', + desc: ' Any number of sub strings the file name should contain, separated by vertical bars.', + type: '', + accepts: '', + default: '', + required: false, + added: '', + examples: [ + { + tag_example: `{exp:low_random:file folder="3" filter=".pdf"}`, + outputs: `` + } + ] + }, + + + ] + } + ] + }, + + { + tag: 'exp:low_random:item', + shortname: 'exp_', + summary: "", + desc: "", + sections: [ + { + type: 'params', + title: 'Tag Parameters', + desc: '', + items: [ + { + item: 'items', + desc: 'Any number of items, separated by vertical bars.', + type: '', + accepts: '', + default: '', + required: false, + added: '', + examples: [ + { + tag_example: `{exp:low_random:item items="cat|dog|ferret|raptor"}`, + outputs: `` + } + ] + }, + + + ] + } + ] + }, + + { + tag: '{exp:low_random:items}', + shortname: 'exp_', + summary: "", + desc: "", + sections: [ + { + type: 'params', + title: 'Tag Parameters', + desc: '', + items: [ + { + item: 'separator', + desc: 'Character used to separate values. Defaults to new line.', + type: '', + accepts: '', + default: '', + required: false, + added: '', + examples: [ + { + tag_example: ` + {exp:low_random:items separator=","} + Cat, Dog, Ferret, Raptor + {/exp:low_random:items}`, + outputs: `` + } + ] + }, + { + item: 'trim', + desc: ' Set to “no” if you don’t want the tagdata to be stripped of white space at the beginning and end.', + type: '', + accepts: '', + default: '', + required: false, + added: '', + examples: [ + { + tag_example: ``, + outputs: `` + } + ] + }, + + + ] + } + ] + }, + + { + tag: '{exp:low_random:letter}', + shortname: 'exp_', + summary: "", + desc: "Note: this tag returns a letter in the same case as the given parameters.", + sections: [ + { + type: 'params', + title: 'Tag Parameters', + desc: '', + items: [ + { + item: 'from', + desc: ' Letter to start the range with, defaults to a', + type: '', + accepts: '', + default: 'a', + required: false, + added: '', + examples: [ + { + tag_example: `{exp:low_random:letter from="A" to="F"}`, + outputs: `` + } + ] + }, + { + item: 'to', + desc: 'Letter to end the range with, defaults to z.', + type: '', + accepts: '', + default: 'z', + required: false, + added: '', + examples: [ + { + tag_example: ``, + outputs: `` + } + ] + }, + + + ] + } + ] + }, + + { + tag: '{exp:low_random:number}', + shortname: 'exp_', + summary: "", + desc: "", + sections: [ + { + type: 'params', + title: 'Tag Parameters', + desc: '', + items: [ + { + item: 'from ', + desc: ' Number to start the range with, defaults to 0.', + type: '', + accepts: '', + default: '0', + required: false, + added: '', + examples: [ + { + tag_example: `{exp:low_random:number from="100" to="999"}`, + outputs: `` + } + ] + }, + { + item: 'to', + desc: 'Number to end the range with, defaults to 9.', + type: '', + accepts: '', + default: '9', + required: false, + added: '', + examples: [ + { + tag_example: ``, + outputs: `` + } + ] + }, + + + ] + } + ] + }, + + + + ] +}; \ No newline at end of file
EEHarbor/low_random
66938c09ccff92b5e9c5ab3f8e72f700eeb53579
Added changelog. Major version bump
diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b760367 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + + +## [4.0.0] - 2021-02-25 +### Added +- EE5 & EE6 Compatibility + +## [3.0.0] - 2017-12-25 +### Added +- EE3 & EE4 Compatibility + +## [2.3.0] - 2015-07-08 +### Added +- Support for config overrides for upload destinations + +## [2.2.0] - 2013-06-06 +### Added +- EE 2.6 compatiblity +- PHP 5.6 compatiblity + +## [2.1.0] - 2009-12-09 +### Added +- `exp:low_random:items` tag pair + +## [2.0.0] - 2009-11-25 +### Added +- EE 2 compatiblity + +## [1.1.0] - 2009-11-09 +### Added +- `exp:low_random:items` tag pair + +## 1.0.0 - 2009-01-07 +### Added +- First Release! + +[Unreleased]: https://github.com/packettide/wygwam/compare/v4.0.0...HEAD +[4.0.0]: https://github.com/packettide/wygwam/compare/v3.0.0...v4.0.0 +[3.0.0]: https://github.com/packettide/wygwam/compare/v2.3.0...v3.0.0 +[2.3.0]: https://github.com/packettide/wygwam/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/packettide/wygwam/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/packettide/wygwam/compare/v2.0.0...v2.1.0 +[2.0.0]: https://github.com/packettide/wygwam/compare/v1.1.0...v2.0.0 +[1.1.0]: https://github.com/packettide/wygwam/compare/v1.0.0...v1.1.0 \ No newline at end of file diff --git a/low_random/addon.json b/low_random/addon.json index 7b3ad90..1a5dba5 100644 --- a/low_random/addon.json +++ b/low_random/addon.json @@ -1,16 +1,16 @@ { "name": "Low Random", "shortname": "low_random", - "version": "3.0.0", + "version": "4.0.0", "foundation_version": "4.6.1", "description": "Generates randomness", "license": "EEHarbor", "namespace": "Low\\Random", "require": { "php": ">=5.6.*", "expressionengine/core": ">=3" }, "resources": { - + } } \ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index e0ff2ab..0000000 --- a/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Low Random for ExpressionEngine 3 - 6 - -See [gotolow.com](http://gotolow.com/addons/low-random) for more info.
EEHarbor/low_random
56bdada4928324890b7b8ef73022c37c4b41a640
Formatting
diff --git a/low_random/autoload.php b/low_random/autoload.php index 211240f..9fdc63b 100755 --- a/low_random/autoload.php +++ b/low_random/autoload.php @@ -1,92 +1,91 @@ <?php /** * EEHarbor PHAR Loader for low_random * Register a new auto-loader to handle loading files from the * PHAR in various environments (w/ opcache, w/o phar stream, etc). * * PHP Version >= 5.3 * * @category Helper * @package ExpressionEngine * @subpackage Foundation * @author EEHarbor <help@eeharbor.com> * @license https://eeharbor.com/license EEHarbor Add-on License * @link https://eeharbor.com/low_random */ - spl_autoload_register( function ($class_name) { // This is the PHAR path for this addon $phar_path = PATH_THIRD . 'low_random/low_random.phar'; $phar_stream_path = 'phar://' . $phar_path; $tmp_phar_path = sys_get_temp_dir() . '/pharextract/low_random'; $namespace = 'Low\Random'; // Add 'FluxCapacitor' when checking our namespace otherwise we could have // a false positive if the class file does not extend anything in FluxCapacitor // as the raw namespace would still match. $check_namespace = $namespace . '\FluxCapacitor'; // If the class name does not start with the check_namespace, it's not from here // or it's not extending FluxCapacitor so return early. if (substr($class_name, 0, strlen($check_namespace)) !== $check_namespace) { return null; } // Now lets strip out the namespace $class_name = str_replace($namespace, '', $class_name); // Format the class name to filesystem format (\Model\Example\ => Model/Example) $class_name = trim($class_name, '\\'); $class_name = str_replace('\\', '/', $class_name); // Make sure the phar exists. if (file_exists($phar_path)) { // If the phar extension is loaded, use that, otherwise, use the self-extraction method. if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) { $phar_stream = true; include_once $phar_path; // Build the path directly into the phar file right to the file we need. // You can't do this if the phar extension is not loaded. $class_file_path = $phar_stream_path; } else { $phar_stream = false; // If the extension is not loaded, we have to load the phar like a // normal file. There is code inside the phar that will extract the // files into the server's tmp folder where we can then include the // files we need individually (it'll remove the temp files after). include_once $phar_path; // Build the path to the file in the temp directory. $class_file_path = $tmp_phar_path; } // Add the actual class filename to whatever path we need to use. $class_file = $class_file_path . '/' . $class_name . '.php'; // If class file exists either in the phar or temp dir, load it. if (file_exists($class_file) && ($phar_stream === true || ($phar_stream === false && stream_resolve_include_path($class_file)) !== false)) { $opcache_config = false; if (function_exists('opcache_get_configuration')) { $opcache_config = @opcache_get_configuration(); } // You can't include a query string on an include unless it's being included as a phar stream. if ($phar_stream === true && !empty($opcache_config) && !empty($opcache_config['directives']['opcache.validate_permission']) && $opcache_config['directives']['opcache.validate_permission'] === true) { include $class_file . '?nocache=' . microtime(true); } else { include $class_file; } } else { throw new \Exception('Class at location ' . $class_file . ' not found.'); } } else { throw new \Exception('Add-on PHAR file at location ' . $phar_path . ' not found.'); } } ); diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index eceec45..18083ea 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,192 +1,195 @@ -<?php if (! defined('BASEPATH')) { +<?php + +if (! defined('BASEPATH')) { exit('No direct script access allowed'); } /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ - include_once "addon.setup.php"; use Low\Random\FluxCapacitor\Base\Pi; class Low_random extends Pi { - // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * * @var array */ private $set = array(); // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ public function item() { $this->set = explode('|', ee()->TMPL->fetch_param('items')); + return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ public function items() { // get tagdata $str = ee()->TMPL->tagdata; // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * * @return string */ public function letter() { return $this->_range('a', 'z'); } /** * Random number between 2 values */ public function number() { return $this->_range(0, 9); } /** * Random item from range set */ private function _range($from = '', $to = '') { // Get params with given defaults $from = ee()->TMPL->fetch_param('from', $from); $to = ee()->TMPL->fetch_param('to', $to); // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ public function file() { $folder = ee()->TMPL->fetch_param('folder'); $filter = ee()->TMPL->fetch_param('filter'); // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { $bob = ee('Model') ->get('File') ->with('UploadDestination') ->filter('UploadDestination.id', $folder); foreach ($filters as $needle) { - $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); + $bob->filter('file_name', 'LIKE', '%' . $needle . '%'); } foreach ($bob->all() as $file) { - $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; + $this->set[] = rtrim($file->UploadDestination->url, '/') . '/' . $file->file_name; } } elseif (is_dir($folder)) { ee()->load->helper('file'); $this->set = $files = get_filenames($folder); if ($filters) { $this->filter($filters); } } return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Filter the array of items based on the absence of filters * * @param string $folder * @return string */ private function filter(array $filters) { foreach ($this->set as $i => $val) { foreach ($filters as $needle) { if (strpos($val, $needle) === false) { unset($this->set[$i]); + continue; } } } $this->set = array_values($this->set); } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ private function _random_item_from_set() { - ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); + ee()->TMPL->log_item('Low Random: getting random item from:<br>' . implode('<br>', $this->set)); + return $this->set ? (string) $this->set[array_rand($this->set)] : ''; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
a90ea9c4cc72a441d7de90cd3c377cab1bc79a8d
Added use and extend to
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index b99774e..eceec45 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,188 +1,192 @@ <?php if (! defined('BASEPATH')) { exit('No direct script access allowed'); } /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ -class Low_random + +include_once "addon.setup.php"; +use Low\Random\FluxCapacitor\Base\Pi; + +class Low_random extends Pi { // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * - * @var array + * @var array */ private $set = array(); // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * - * @param string $str - * @return string + * @param string $str + * @return string */ public function item() { $this->set = explode('|', ee()->TMPL->fetch_param('items')); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * - * @since 2.1 - * @param string $str - * @return string + * @since 2.1 + * @param string $str + * @return string */ public function items() { // get tagdata $str = ee()->TMPL->tagdata; // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * - * @return string + * @return string */ public function letter() { return $this->_range('a', 'z'); } /** * Random number between 2 values */ public function number() { return $this->_range(0, 9); } /** * Random item from range set */ private function _range($from = '', $to = '') { // Get params with given defaults $from = ee()->TMPL->fetch_param('from', $from); - $to = ee()->TMPL->fetch_param('to', $to); + $to = ee()->TMPL->fetch_param('to', $to); // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Get random file from file system * - * @param string $folder - * @param string $filter - * @return string + * @param string $folder + * @param string $filter + * @return string */ public function file() { $folder = ee()->TMPL->fetch_param('folder'); $filter = ee()->TMPL->fetch_param('filter'); // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { $bob = ee('Model') ->get('File') ->with('UploadDestination') ->filter('UploadDestination.id', $folder); foreach ($filters as $needle) { $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); } foreach ($bob->all() as $file) { $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; } } elseif (is_dir($folder)) { ee()->load->helper('file'); $this->set = $files = get_filenames($folder); if ($filters) { $this->filter($filters); } } return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Filter the array of items based on the absence of filters * - * @param string $folder - * @return string + * @param string $folder + * @return string */ private function filter(array $filters) { foreach ($this->set as $i => $val) { foreach ($filters as $needle) { if (strpos($val, $needle) === false) { unset($this->set[$i]); continue; } } } $this->set = array_values($this->set); } // -------------------------------------------------------------------- /** * Random item from set (array) * - * @return string + * @return string */ private function _random_item_from_set() { ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); return $this->set ? (string) $this->set[array_rand($this->set)] : ''; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
f55985ac807b104db5f60325f4de868b1d550081
Foundation
diff --git a/low_random/addon.json b/low_random/addon.json index e10e58b..7b3ad90 100644 --- a/low_random/addon.json +++ b/low_random/addon.json @@ -1,14 +1,16 @@ { - "name": "Low Random", - "shortname": "low_random", - "version": "3.0.0", - "foundation_version": "", - "description": "Generates randomness", - "license": "EEHarbor", - "namespace": "Low\\Random", - "require": { - "php": ">=5.6.*", - "expressionengine/core": ">=3" - }, - "resources": {} -} + "name": "Low Random", + "shortname": "low_random", + "version": "3.0.0", + "foundation_version": "4.6.1", + "description": "Generates randomness", + "license": "EEHarbor", + "namespace": "Low\\Random", + "require": { + "php": ">=5.6.*", + "expressionengine/core": ">=3" + }, + "resources": { + + } +} \ No newline at end of file diff --git a/low_random/autoload.php b/low_random/autoload.php new file mode 100755 index 0000000..211240f --- /dev/null +++ b/low_random/autoload.php @@ -0,0 +1,92 @@ +<?php +/** + * EEHarbor PHAR Loader for low_random + * Register a new auto-loader to handle loading files from the + * PHAR in various environments (w/ opcache, w/o phar stream, etc). + * + * PHP Version >= 5.3 + * + * @category Helper + * @package ExpressionEngine + * @subpackage Foundation + * @author EEHarbor <help@eeharbor.com> + * @license https://eeharbor.com/license EEHarbor Add-on License + * @link https://eeharbor.com/low_random + */ + +spl_autoload_register( + function ($class_name) { + // This is the PHAR path for this addon + $phar_path = PATH_THIRD . 'low_random/low_random.phar'; + $phar_stream_path = 'phar://' . $phar_path; + $tmp_phar_path = sys_get_temp_dir() . '/pharextract/low_random'; + + $namespace = 'Low\Random'; + + // Add 'FluxCapacitor' when checking our namespace otherwise we could have + // a false positive if the class file does not extend anything in FluxCapacitor + // as the raw namespace would still match. + $check_namespace = $namespace . '\FluxCapacitor'; + + // If the class name does not start with the check_namespace, it's not from here + // or it's not extending FluxCapacitor so return early. + if (substr($class_name, 0, strlen($check_namespace)) !== $check_namespace) { + return null; + } + + // Now lets strip out the namespace + $class_name = str_replace($namespace, '', $class_name); + + // Format the class name to filesystem format (\Model\Example\ => Model/Example) + $class_name = trim($class_name, '\\'); + $class_name = str_replace('\\', '/', $class_name); + + // Make sure the phar exists. + if (file_exists($phar_path)) { + // If the phar extension is loaded, use that, otherwise, use the self-extraction method. + if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) { + $phar_stream = true; + + include_once $phar_path; + + // Build the path directly into the phar file right to the file we need. + // You can't do this if the phar extension is not loaded. + $class_file_path = $phar_stream_path; + } else { + $phar_stream = false; + + // If the extension is not loaded, we have to load the phar like a + // normal file. There is code inside the phar that will extract the + // files into the server's tmp folder where we can then include the + // files we need individually (it'll remove the temp files after). + include_once $phar_path; + + // Build the path to the file in the temp directory. + $class_file_path = $tmp_phar_path; + } + + // Add the actual class filename to whatever path we need to use. + $class_file = $class_file_path . '/' . $class_name . '.php'; + + // If class file exists either in the phar or temp dir, load it. + if (file_exists($class_file) && ($phar_stream === true || ($phar_stream === false && stream_resolve_include_path($class_file)) !== false)) { + $opcache_config = false; + + if (function_exists('opcache_get_configuration')) { + $opcache_config = @opcache_get_configuration(); + } + + // You can't include a query string on an include unless it's being included as a phar stream. + if ($phar_stream === true && !empty($opcache_config) && !empty($opcache_config['directives']['opcache.validate_permission']) && $opcache_config['directives']['opcache.validate_permission'] === true) { + include $class_file . '?nocache=' . microtime(true); + } else { + include $class_file; + } + } else { + throw new \Exception('Class at location ' . $class_file . ' not found.'); + } + } else { + throw new \Exception('Add-on PHAR file at location ' . $phar_path . ' not found.'); + } + } +); diff --git a/low_random/low_random.phar b/low_random/low_random.phar new file mode 100644 index 0000000..0118034 Binary files /dev/null and b/low_random/low_random.phar differ diff --git a/low_random/views/license.php b/low_random/views/license.php new file mode 100755 index 0000000..8f70f12 --- /dev/null +++ b/low_random/views/license.php @@ -0,0 +1,221 @@ +<style> +.ee2 { + margin-bottom: 15px; + padding: 10px 10px 1px 10px; + } +.ee2 .tbl-search { + float: right; + display: inline; + border: 0; + position: relative; + z-index: 10; + } +.ee2 h1 { + color: gray; + font-size: 18px; + font-weight: 400; + padding: 10px; + position: relative; + border-bottom: 1px solid #e8e8e8; + background-image: -moz-linear-gradient(top,#fff,#f9f9f9); + background-image: -webkit-linear-gradient(top,#fff,#f9f9f9); + background-image: linear-gradient(to right,top,#fff,#f9f9f9); + } +.ee2 fieldset.col-group { + border: 0; + border-bottom: 1px solid #e3e3e3; + } +.ee2 .col-group .col { + float: left; + display: inline; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } +.ee2 .col-group .col.w-8 { + width: 50%; + } +.ee2 .col-group { + background-color: #fff; + } +.ee2 .setting-txt h3 { + font-size: 14px !important; + } +.ee2 .setting-txt em { + color: gray; + font-size: 12px; + font-style: normal; + margin: 5px 0; + padding-right: 10px; + display: block; + } +.ee2 fieldset.col-group:last-of-type { + margin-bottom: 20px !important; + } +.ee2 .txt-wrap { + padding: 10px; + border: 1px solid #e3e3e3; + border-top: 0; + background-color: #fff; + } +.ee2 .form-submit { + border: 0 !important; + } +.license_status { + margin: 15px 0; + padding: 10px; + line-height: 18px; + background-color: #f5f5f5; + border: 1px solid #e8e8e8; + } +.license_status h4 { + font-weight: bold; + } +.license_status_badge { + margin-bottom: 10px; + } +.license_status_warning { + margin-top: 15px; + padding: 10px; + color: #e0251c; + text-align: center; + border: 1px solid #f59792; + background-color: #fcf5f5; + } +.license_status_disabled .license_status { + border: 2px solid #ff0000; + background-color: #fcf5f5; + } +.license_status_disabled .license_status ol { + margin: 0 0 0 35px !important; + } +.ee6 .license_status { + background-color: var(--ee-bg-5); +} +</style> +<!-- <div class="tbl-ctrls"> --> + +<div class="box ee<?=$ee_ver?> addon-license panel"> + <div class="panel-heading"> + <h1>License</h1> + </div> + + <?php echo form_open($action_url, array('class'=>'settings panel-body')); ?> + +<?php if ($ee_ver > 2) { ?> + <div class="app-notice-wrap"><?php echo ee('CP/Alert')->getAllInlines(); ?></div> +<?php } ?> + <fieldset class="col-group required"> + <div class="setting-txt col w-8"> + <h3>License Key</h3> + <p><em>You can retrieve your license key from <b><a target="_blank" href="https://eeharbor.com/members">your Account page on EEHarbor.com</a></b>.</em></p> + </div> + <div class="setting-field col w-8 last"> + <?php echo form_input('license_key', $license_key); ?> + </div> + </fieldset> + + <fieldset class="col-group license-status-group"> + <div class="setting-txt col w-8"> + <h3>License Status</h3> + </div> + <div class="setting-txt col w-8 last"> + <div class="license_status_badge"></div> + + <div class="license_status_i" style="display:none;"> + <div class="license_status_warning"> + This add-on will cease to function if put on a production website! + </div> + <div class="license_status"> + <h4>Invalid</h4> + <p>We were unable to find a match for your License Key in our system. You can use the add-on while performing + <strong>local development</strong> but you <strong>must</strong> enter a valid license before making your + site live. To purchase a license or look up an existing license, please visit + <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + <div class="license_status_u" style="display:none;"> + <div class="license_status_warning"> + This add-on will cease to function if put on a production website! + </div> + <div class="license_status"> + <h4>Unlicensed</h4> + <p>You have not entered a license key. You can use the add-on while performing <strong>local development</strong> + but you <strong>must</strong> enter a valid license before making your site live. To purchase a license or look + up an existing license, please visit + <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + <div class="license_status license_status_e" style="display:none;"> + <h4>Expired</h4> + <p>Your license is valid but has expired. You can continue to use you add-on while it is expired but if you wish to update + to the latest version, you will need to purchase an upgrade. To upgrade, please login to your account on + <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>, find your license and click the "Renew" button.</p> + </div> + <div class="license_status license_status_d" style="display:none;"> + <h4>Duplicate</h4> + <p>Your license key is currently registered on another website. For more information, please login to your account on + <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + <div class="license_status_w" style="display:none;"> + <div class="license_status_warning"> + This add-on will cease to function if put on a production website! + </div> + <div class="license_status"> + <h4>License Mismatch</h4> + <p>The license key you entered is registered to a different add-on. For more information, please login to your account + on <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + <div class="license_status_p" style="display:none;"> + <div class="license_status_warning"> + This add-on will cease to function if put on a production website! + </div> + <div class="license_status"> + <h4>License Missing Production Domain</h4> + <p>You must enter your production domain in your Account page on EEHarbor.com.</p> + <p>This would be the final domain the add-on is going to run on (i.e. http://www.clientsite.com).</p> + <p>For more information, please login to your account on <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + <div class="license_status_m" style="display:none;"> + <div class="license_status"> + <h4>Maintenance Mode</h4> + <p>The licensing server is undergoing maintenance. Your add-on will not be affected by this. + If you need assistance, please contact us on <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + <div class="license_status_disabled" style="display:none;"> + <div class="license_status"> + <h4>Add-on Disabled</h4> + <p>This add-on has been disabled until a valid license is entered.</p> + <p>The unlicensed use of this add-on on production websites is a violation of the Add-on License Agreement.</p> + <p> + <b>To renable this add-on:</b><br /> + <ol> + <li>Enter a valid license</li> + <li>Enter your production domain for this license on your account page on EEHarbor.com</li> + </ol> + </p> + + <p>If you need assistance, please contact us on <a target="_blank" href="https://eeharbor.com/">EEHarbor.com</a>.</p> + </div> + </div> + </div> + </fieldset> + + <fieldset class="col-group last"> + <div class="setting-txt col w-8"> + <h3>License Agreement</h3> + </div> + <div class="setting-txt col w-8 last"> + <em>By using this software, you agree to the <b><a target="_blank" href="https://eeharbor.com/license">Add-on License Agreement</a></b>.</em> + </div> + </fieldset> + + <fieldset class="form-submit form-ctrls"> + <input class="btn submit" type="submit" value="Save License Key" /> + </fieldset> + + <?php echo form_close(); ?> +</div>
EEHarbor/low_random
b1953a1b89d055c24efa9045f143b016d52d3ade
Added addon.setup
diff --git a/low_random/addon.setup.php b/low_random/addon.setup.php index 9a980a7..c38c25e 100644 --- a/low_random/addon.setup.php +++ b/low_random/addon.setup.php @@ -1,20 +1,15 @@ <?php -/** - * Low Random setup file - * - * @package low_random - * @author Lodewijk Schutte <hi@gotolow.com> - * @link http://gotolow.com/addons/low-random - * @copyright Copyright (c) 2017, Low - */ +require_once 'autoload.php'; +$addonJson = json_decode(file_get_contents(__DIR__ . '/addon.json')); return array( - 'author' => 'Low', - 'author_url' => 'http://gotolow.com/', - 'docs_url' => 'http://gotolow.com/addons/low-random', - 'name' => 'Low Random', - 'description' => 'Generates randomness', - 'version' => '3.0.0', - 'namespace' => 'Low\Random' + 'name' => $addonJson->name, + 'description' => $addonJson->description, + 'version' => $addonJson->version, + 'namespace' => $addonJson->namespace, + 'author' => 'EEHarbor', + 'author_url' => 'http://eeharbor.com/low_random', + 'docs_url' => 'http://eeharbor.com/low_random/documentation', + 'settings_exist' => false, );
EEHarbor/low_random
6dc2f4e289ce8781aeeb03f3acb4ad24b43fde01
PSR-12
diff --git a/low_random/addon.setup.php b/low_random/addon.setup.php index 5a2e228..9a980a7 100644 --- a/low_random/addon.setup.php +++ b/low_random/addon.setup.php @@ -1,20 +1,20 @@ <?php /** * Low Random setup file * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-random * @copyright Copyright (c) 2017, Low */ return array( - 'author' => 'Low', - 'author_url' => 'http://gotolow.com/', - 'docs_url' => 'http://gotolow.com/addons/low-random', - 'name' => 'Low Random', - 'description' => 'Generates randomness', - 'version' => '3.0.0', - 'namespace' => 'Low\Random' + 'author' => 'Low', + 'author_url' => 'http://gotolow.com/', + 'docs_url' => 'http://gotolow.com/addons/low-random', + 'name' => 'Low Random', + 'description' => 'Generates randomness', + 'version' => '3.0.0', + 'namespace' => 'Low\Random' ); diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index d0eeac7..b99774e 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,196 +1,188 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if (! defined('BASEPATH')) { + exit('No direct script access allowed'); +} /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ -class Low_random { - - // -------------------------------------------------------------------- - // PROPERTIES - // -------------------------------------------------------------------- - - /** - * Set of items to choose from - * - * @var array - */ - private $set = array(); - - // -------------------------------------------------------------------- - // METHODS - // -------------------------------------------------------------------- - - /** - * Randomize given items, pipe delimited - * - * @param string $str - * @return string - */ +class Low_random +{ + + // -------------------------------------------------------------------- + // PROPERTIES + // -------------------------------------------------------------------- + + /** + * Set of items to choose from + * + * @var array + */ + private $set = array(); + + // -------------------------------------------------------------------- + // METHODS + // -------------------------------------------------------------------- + + /** + * Randomize given items, pipe delimited + * + * @param string $str + * @return string + */ public function item() { - $this->set = explode('|', ee()->TMPL->fetch_param('items')); - return $this->_random_item_from_set(); + $this->set = explode('|', ee()->TMPL->fetch_param('items')); + return $this->_random_item_from_set(); } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- - /** - * Randomize tagdata - * - * @since 2.1 - * @param string $str - * @return string - */ + /** + * Randomize tagdata + * + * @since 2.1 + * @param string $str + * @return string + */ public function items() { - // get tagdata - $str = ee()->TMPL->tagdata; + // get tagdata + $str = ee()->TMPL->tagdata; + + // trim if necessary + if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { + $str = trim($str); + } + + // get separator + $sep = ee()->TMPL->fetch_param('separator', "\n"); + + // create array from tagdata + $this->set = explode($sep, $str); + + return $this->_random_item_from_set(); + } + + // -------------------------------------------------------------------- + + /** + * Randomize the given letter range + * + * @return string + */ + public function letter() + { + return $this->_range('a', 'z'); + } + + /** + * Random number between 2 values + */ + public function number() + { + return $this->_range(0, 9); + } + + /** + * Random item from range set + */ + private function _range($from = '', $to = '') + { + // Get params with given defaults + $from = ee()->TMPL->fetch_param('from', $from); + $to = ee()->TMPL->fetch_param('to', $to); + + // fill set + $this->set = range($from, $to); + + return $this->_random_item_from_set(); + } - // trim if necessary - if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') - { - $str = trim($str); - } + // -------------------------------------------------------------------- - // get separator - $sep = ee()->TMPL->fetch_param('separator', "\n"); + /** + * Get random file from file system + * + * @param string $folder + * @param string $filter + * @return string + */ + public function file() + { + $folder = ee()->TMPL->fetch_param('folder'); + $filter = ee()->TMPL->fetch_param('filter'); + + // Convert filter to array + $filters = strlen($filter) ? explode('|', $filter) : array(); + + // is folder a number? + if (is_numeric($folder)) { + $bob = ee('Model') + ->get('File') + ->with('UploadDestination') + ->filter('UploadDestination.id', $folder); + + foreach ($filters as $needle) { + $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); + } + + foreach ($bob->all() as $file) { + $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; + } + } elseif (is_dir($folder)) { + ee()->load->helper('file'); + $this->set = $files = get_filenames($folder); + + if ($filters) { + $this->filter($filters); + } + } + + return $this->_random_item_from_set(); + } - // create array from tagdata - $this->set = explode($sep, $str); + // -------------------------------------------------------------------- - return $this->_random_item_from_set(); + /** + * Filter the array of items based on the absence of filters + * + * @param string $folder + * @return string + */ + private function filter(array $filters) + { + foreach ($this->set as $i => $val) { + foreach ($filters as $needle) { + if (strpos($val, $needle) === false) { + unset($this->set[$i]); + continue; + } + } + } + + $this->set = array_values($this->set); } - // -------------------------------------------------------------------- - - /** - * Randomize the given letter range - * - * @return string - */ - public function letter() - { - return $this->_range('a', 'z'); - } - - /** - * Random number between 2 values - */ - public function number() - { - return $this->_range(0, 9); - } - - /** - * Random item from range set - */ - private function _range($from = '', $to = '') - { - // Get params with given defaults - $from = ee()->TMPL->fetch_param('from', $from); - $to = ee()->TMPL->fetch_param('to', $to); - - // fill set - $this->set = range($from, $to); - - return $this->_random_item_from_set(); - } - - // -------------------------------------------------------------------- - - /** - * Get random file from file system - * - * @param string $folder - * @param string $filter - * @return string - */ - public function file() - { - $folder = ee()->TMPL->fetch_param('folder'); - $filter = ee()->TMPL->fetch_param('filter'); - - // Convert filter to array - $filters = strlen($filter) ? explode('|', $filter) : array(); - - // is folder a number? - if (is_numeric($folder)) - { - $bob = ee('Model') - ->get('File') - ->with('UploadDestination') - ->filter('UploadDestination.id', $folder); - - foreach($filters as $needle) - { - $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); - } - - foreach ($bob->all() as $file) - { - $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; - } - } - elseif (is_dir($folder)) - { - ee()->load->helper('file'); - $this->set = $files = get_filenames($folder); - - if ($filters) - { - $this->filter($filters); - } - } - - return $this->_random_item_from_set(); - } - - // -------------------------------------------------------------------- - - /** - * Filter the array of items based on the absence of filters - * - * @param string $folder - * @return string - */ - private function filter(array $filters) - { - foreach ($this->set as $i => $val) - { - foreach ($filters as $needle) - { - if (strpos($val, $needle) === FALSE) - { - unset($this->set[$i]); - continue; - } - } - } - - $this->set = array_values($this->set); - } - - // -------------------------------------------------------------------- - - /** - * Random item from set (array) - * - * @return string - */ - private function _random_item_from_set() - { - ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); - return $this->set ? (string) $this->set[array_rand($this->set)] : ''; - } - - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- + + /** + * Random item from set (array) + * + * @return string + */ + private function _random_item_from_set() + { + ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); + return $this->set ? (string) $this->set[array_rand($this->set)] : ''; + } + // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
246227c4b22579f1a07e7b286bb62767752d6529
Return empty string when set is empty
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index d78d27c..d0eeac7 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,196 +1,196 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ class Low_random { // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * * @var array */ private $set = array(); // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ public function item() { $this->set = explode('|', ee()->TMPL->fetch_param('items')); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ public function items() { // get tagdata $str = ee()->TMPL->tagdata; // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * * @return string */ public function letter() { return $this->_range('a', 'z'); } /** * Random number between 2 values */ public function number() { return $this->_range(0, 9); } /** * Random item from range set */ private function _range($from = '', $to = '') { // Get params with given defaults $from = ee()->TMPL->fetch_param('from', $from); $to = ee()->TMPL->fetch_param('to', $to); // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ public function file() { $folder = ee()->TMPL->fetch_param('folder'); $filter = ee()->TMPL->fetch_param('filter'); // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { $bob = ee('Model') ->get('File') ->with('UploadDestination') ->filter('UploadDestination.id', $folder); foreach($filters as $needle) { $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); } foreach ($bob->all() as $file) { $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; } } elseif (is_dir($folder)) { ee()->load->helper('file'); $this->set = $files = get_filenames($folder); if ($filters) { $this->filter($filters); } } return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Filter the array of items based on the absence of filters * * @param string $folder * @return string */ private function filter(array $filters) { foreach ($this->set as $i => $val) { foreach ($filters as $needle) { if (strpos($val, $needle) === FALSE) { unset($this->set[$i]); continue; } } } $this->set = array_values($this->set); } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ private function _random_item_from_set() { ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); - return (string) $this->set[array_rand($this->set)]; + return $this->set ? (string) $this->set[array_rand($this->set)] : ''; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
8be72b2f6bfbedd08daeb3ed05457990bc285054
EE3+4 compatibility
diff --git a/low_random/addon.setup.php b/low_random/addon.setup.php new file mode 100644 index 0000000..5a2e228 --- /dev/null +++ b/low_random/addon.setup.php @@ -0,0 +1,20 @@ +<?php + +/** + * Low Random setup file + * + * @package low_random + * @author Lodewijk Schutte <hi@gotolow.com> + * @link http://gotolow.com/addons/low-random + * @copyright Copyright (c) 2017, Low + */ + +return array( + 'author' => 'Low', + 'author_url' => 'http://gotolow.com/', + 'docs_url' => 'http://gotolow.com/addons/low-random', + 'name' => 'Low Random', + 'description' => 'Generates randomness', + 'version' => '3.0.0', + 'namespace' => 'Low\Random' +); diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index 5b01c19..d78d27c 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,315 +1,196 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); -$plugin_info = array( - 'pi_name' => 'Low Random', - 'pi_version' => '2.3.0', - 'pi_author' => 'Lodewijk Schutte ~ Low', - 'pi_author_url' => 'http://gotolow.com/addons/low-random', - 'pi_description' => 'Returns randomness.', - 'pi_usage' => 'See http://gotolow.com/addons/low-random for more info.' -); - -/** - * < EE 2.6.0 backward compat - */ -if ( ! function_exists('ee')) -{ - function ee() - { - static $EE; - if ( ! $EE) $EE = get_instance(); - return $EE; - } -} - /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ class Low_random { // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * * @var array */ private $set = array(); - /** - * Debug mode - * - * @var bool - */ - private $debug = FALSE; - // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ - public function item($str = '') + public function item() { - if ($str == '') - { - $str = ee()->TMPL->fetch_param('items', ''); - } - - $this->set = explode('|', $str); - + $this->set = explode('|', ee()->TMPL->fetch_param('items')); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ - public function items($str = '') + public function items() { // get tagdata - if ($str == '') - { - $str = ee()->TMPL->tagdata; - } + $str = ee()->TMPL->tagdata; // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * - * @param string $from - * @param string $to * @return string */ - public function letter($from = '', $to = '') + public function letter() { - // Parameters - if ($from == '') - { - $from = ee()->TMPL->fetch_param('from', 'a'); - } - - if ($to == '') - { - $to = ee()->TMPL->fetch_param('to', 'z'); - } - - // no from? Set to a - if (!preg_match('/^[a-z]$/i', $from)) - { - $from = 'a'; - } - - // no to? Set to z - if (!preg_match('/^[a-z]$/i', $to)) - { - $to = 'z'; - } - - // fill set - $this->set = range($from, $to); - - return $this->_random_item_from_set(); + return $this->_range('a', 'z'); } - // -------------------------------------------------------------------- - /** * Random number between 2 values - * - * @param string $from - * @param string $to - * @return string */ - public function number($from = '', $to = '') + public function number() { - // Parameters - if ($from == '') - { - $from = ee()->TMPL->fetch_param('from', '0'); - } - - if ($to == '') - { - $to = ee()->TMPL->fetch_param('to', '9'); - } + return $this->_range(0, 9); + } - // no from? Set to 0 - if (!is_numeric($from)) - { - $from = '0'; - } + /** + * Random item from range set + */ + private function _range($from = '', $to = '') + { + // Get params with given defaults + $from = ee()->TMPL->fetch_param('from', $from); + $to = ee()->TMPL->fetch_param('to', $to); - // no to? Set to 9 - if (!is_numeric($to)) - { - $to = '9'; - } + // fill set + $this->set = range($from, $to); - // return random number - return strval(rand(intval($from), intval($to))); + return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ - public function file($folder = '', $filter = '') + public function file() { - // init var - $error = FALSE; - - // Parameters - if ($folder == '') - { - $folder = ee()->TMPL->fetch_param('folder'); - } - - if ($filter == '') - { - $filter = ee()->TMPL->fetch_param('filter', ''); - } + $folder = ee()->TMPL->fetch_param('folder'); + $filter = ee()->TMPL->fetch_param('filter'); // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { - // get server path from upload prefs - ee()->load->model('file_upload_preferences_model'); - $upload_prefs = ee()->file_upload_preferences_model->get_file_upload_preferences(1, $folder); + $bob = ee('Model') + ->get('File') + ->with('UploadDestination') + ->filter('UploadDestination.id', $folder); - // Do we have a match? get path - if ($upload_prefs) + foreach($filters as $needle) { - $folder = $upload_prefs['server_path']; + $bob->filter('file_name', 'LIKE', '%'.$needle.'%'); } - } - // Simple folder check - if (!strlen($folder)) - { - $error = TRUE; - } - else - { - // check for trailing slash - if (substr($folder, -1, 1) != '/') + foreach ($bob->all() as $file) { - $folder .= '/'; + $this->set[] = rtrim($file->UploadDestination->url, '/') .'/'. $file->file_name; } } - - // Another folder check - if (!is_dir($folder)) + elseif (is_dir($folder)) { - $error = TRUE; - } - else - { - // open dir - $dir = opendir($folder); + ee()->load->helper('file'); + $this->set = $files = get_filenames($folder); - // loop through folder - while($f = readdir($dir)) + if ($filters) { - // no file? skip - if (!is_file($folder.$f)) continue; - - // set addit to 0, check filters - $addit = 0; - - // check if filter applies - foreach ($filters AS $filter) - { - if (strlen($filter) && substr_count($f, $filter)) - { - $addit++; - } - } - - // if we have a match, add file to array - if ($addit == count($filters)) - { - $this->set[] = $f; - } + $this->filter($filters); } - - // close dir - closedir($dir); } - // return data - return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); + return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** - * Display invalid folder if debug is on + * Filter the array of items based on the absence of filters * * @param string $folder * @return string */ - private function _invalid_folder($folder = '') + private function filter(array $filters) { - // return error message if debug-mode is on - return $this->debug ? "{$folder} is an invalid folder" : ''; + foreach ($this->set as $i => $val) + { + foreach ($filters as $needle) + { + if (strpos($val, $needle) === FALSE) + { + unset($this->set[$i]); + continue; + } + } + } + + $this->set = array_values($this->set); } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ private function _random_item_from_set() { - return $this->set[array_rand($this->set)]; + ee()->TMPL->log_item('Low Random: getting random item from:<br>'.implode('<br>', $this->set)); + return (string) $this->set[array_rand($this->set)]; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
575c6807462ccf012bd985d3fc8991b6f740caa9
Version++
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index f18d397..5b01c19 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,315 +1,315 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $plugin_info = array( 'pi_name' => 'Low Random', - 'pi_version' => '2.2.0', + 'pi_version' => '2.3.0', 'pi_author' => 'Lodewijk Schutte ~ Low', 'pi_author_url' => 'http://gotolow.com/addons/low-random', 'pi_description' => 'Returns randomness.', 'pi_usage' => 'See http://gotolow.com/addons/low-random for more info.' ); /** * < EE 2.6.0 backward compat */ if ( ! function_exists('ee')) { function ee() { static $EE; if ( ! $EE) $EE = get_instance(); return $EE; } } /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ class Low_random { // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * * @var array */ private $set = array(); /** * Debug mode * * @var bool */ private $debug = FALSE; // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ public function item($str = '') { if ($str == '') { $str = ee()->TMPL->fetch_param('items', ''); } $this->set = explode('|', $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ public function items($str = '') { // get tagdata if ($str == '') { $str = ee()->TMPL->tagdata; } // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * * @param string $from * @param string $to * @return string */ public function letter($from = '', $to = '') { // Parameters if ($from == '') { $from = ee()->TMPL->fetch_param('from', 'a'); } if ($to == '') { $to = ee()->TMPL->fetch_param('to', 'z'); } // no from? Set to a if (!preg_match('/^[a-z]$/i', $from)) { $from = 'a'; } // no to? Set to z if (!preg_match('/^[a-z]$/i', $to)) { $to = 'z'; } // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Random number between 2 values * * @param string $from * @param string $to * @return string */ public function number($from = '', $to = '') { // Parameters if ($from == '') { $from = ee()->TMPL->fetch_param('from', '0'); } if ($to == '') { $to = ee()->TMPL->fetch_param('to', '9'); } // no from? Set to 0 if (!is_numeric($from)) { $from = '0'; } // no to? Set to 9 if (!is_numeric($to)) { $to = '9'; } // return random number return strval(rand(intval($from), intval($to))); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ public function file($folder = '', $filter = '') { // init var $error = FALSE; // Parameters if ($folder == '') { $folder = ee()->TMPL->fetch_param('folder'); } if ($filter == '') { $filter = ee()->TMPL->fetch_param('filter', ''); } // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { // get server path from upload prefs ee()->load->model('file_upload_preferences_model'); $upload_prefs = ee()->file_upload_preferences_model->get_file_upload_preferences(1, $folder); // Do we have a match? get path if ($upload_prefs) { $folder = $upload_prefs['server_path']; } } // Simple folder check if (!strlen($folder)) { $error = TRUE; } else { // check for trailing slash if (substr($folder, -1, 1) != '/') { $folder .= '/'; } } // Another folder check if (!is_dir($folder)) { $error = TRUE; } else { // open dir $dir = opendir($folder); // loop through folder while($f = readdir($dir)) { // no file? skip if (!is_file($folder.$f)) continue; // set addit to 0, check filters $addit = 0; // check if filter applies foreach ($filters AS $filter) { if (strlen($filter) && substr_count($f, $filter)) { $addit++; } } // if we have a match, add file to array if ($addit == count($filters)) { $this->set[] = $f; } } // close dir closedir($dir); } // return data return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Display invalid folder if debug is on * * @param string $folder * @return string */ private function _invalid_folder($folder = '') { // return error message if debug-mode is on return $this->debug ? "{$folder} is an invalid folder" : ''; } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ private function _random_item_from_set() { return $this->set[array_rand($this->set)]; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */
EEHarbor/low_random
df1b3089337ed5a5f200741e4a0c23297faeba38
Add support for configuration overrides.
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index 59c197a..f18d397 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,317 +1,315 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $plugin_info = array( 'pi_name' => 'Low Random', 'pi_version' => '2.2.0', 'pi_author' => 'Lodewijk Schutte ~ Low', 'pi_author_url' => 'http://gotolow.com/addons/low-random', 'pi_description' => 'Returns randomness.', 'pi_usage' => 'See http://gotolow.com/addons/low-random for more info.' ); /** * < EE 2.6.0 backward compat */ if ( ! function_exists('ee')) { function ee() { static $EE; if ( ! $EE) $EE = get_instance(); return $EE; } } /** * Low Random Plugin class * * @package low_random * @author Lodewijk Schutte <hi@gotolow.com> * @link http://gotolow.com/addons/low-nice-date * @license http://creativecommons.org/licenses/by-sa/3.0/ */ class Low_random { // -------------------------------------------------------------------- // PROPERTIES // -------------------------------------------------------------------- /** * Set of items to choose from * * @var array */ private $set = array(); /** * Debug mode * * @var bool */ private $debug = FALSE; // -------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ public function item($str = '') { if ($str == '') { $str = ee()->TMPL->fetch_param('items', ''); } $this->set = explode('|', $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ public function items($str = '') { // get tagdata if ($str == '') { $str = ee()->TMPL->tagdata; } // trim if necessary if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } // get separator $sep = ee()->TMPL->fetch_param('separator', "\n"); // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Randomize the given letter range * * @param string $from * @param string $to * @return string */ public function letter($from = '', $to = '') { // Parameters if ($from == '') { $from = ee()->TMPL->fetch_param('from', 'a'); } if ($to == '') { $to = ee()->TMPL->fetch_param('to', 'z'); } // no from? Set to a if (!preg_match('/^[a-z]$/i', $from)) { $from = 'a'; } // no to? Set to z if (!preg_match('/^[a-z]$/i', $to)) { $to = 'z'; } // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Random number between 2 values * * @param string $from * @param string $to * @return string */ public function number($from = '', $to = '') { // Parameters if ($from == '') { $from = ee()->TMPL->fetch_param('from', '0'); } if ($to == '') { $to = ee()->TMPL->fetch_param('to', '9'); } // no from? Set to 0 if (!is_numeric($from)) { $from = '0'; } // no to? Set to 9 if (!is_numeric($to)) { $to = '9'; } // return random number return strval(rand(intval($from), intval($to))); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ public function file($folder = '', $filter = '') { // init var $error = FALSE; // Parameters if ($folder == '') { $folder = ee()->TMPL->fetch_param('folder'); } if ($filter == '') { $filter = ee()->TMPL->fetch_param('filter', ''); } // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { // get server path from upload prefs - $query = ee()->db->select('server_path') - ->from('upload_prefs') - ->where('id', $folder) - ->get(); + ee()->load->model('file_upload_preferences_model'); + $upload_prefs = ee()->file_upload_preferences_model->get_file_upload_preferences(1, $folder); // Do we have a match? get path - if ($query->num_rows()) + if ($upload_prefs) { - $folder = $query->row('server_path'); + $folder = $upload_prefs['server_path']; } } // Simple folder check if (!strlen($folder)) { $error = TRUE; } else { // check for trailing slash if (substr($folder, -1, 1) != '/') { $folder .= '/'; } } // Another folder check if (!is_dir($folder)) { $error = TRUE; } else { // open dir $dir = opendir($folder); // loop through folder while($f = readdir($dir)) { // no file? skip if (!is_file($folder.$f)) continue; // set addit to 0, check filters $addit = 0; // check if filter applies foreach ($filters AS $filter) { if (strlen($filter) && substr_count($f, $filter)) { $addit++; } } // if we have a match, add file to array if ($addit == count($filters)) { $this->set[] = $f; } } // close dir closedir($dir); } // return data return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Display invalid folder if debug is on * * @param string $folder * @return string */ private function _invalid_folder($folder = '') { // return error message if debug-mode is on return $this->debug ? "{$folder} is an invalid folder" : ''; } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ private function _random_item_from_set() { return $this->set[array_rand($this->set)]; } // -------------------------------------------------------------------- } // END CLASS -/* End of file pi.low_random.php */ \ No newline at end of file +/* End of file pi.low_random.php */
EEHarbor/low_random
c6e369c5a32dfbcc12e86539d642ff47764dd03d
EE260 stuff
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index a5774af..59c197a 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,372 +1,317 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $plugin_info = array( - 'pi_name' => 'Low Random', - 'pi_version' => '2.1', - 'pi_author' => 'Lodewijk Schutte ~ Low', - 'pi_author_url' => 'http://loweblog.com/software/low-random/', - 'pi_description' => 'Returns randomness', - 'pi_usage' => Low_random::usage() + 'pi_name' => 'Low Random', + 'pi_version' => '2.2.0', + 'pi_author' => 'Lodewijk Schutte ~ Low', + 'pi_author_url' => 'http://gotolow.com/addons/low-random', + 'pi_description' => 'Returns randomness.', + 'pi_usage' => 'See http://gotolow.com/addons/low-random for more info.' ); /** -* Low Random Plugin class -* -* @package low-random-ee2_addon -* @version 2.1 -* @author Lodewijk Schutte ~ Low <low@loweblog.com> -* @link http://loweblog.com/software/low-random/ -* @license http://creativecommons.org/licenses/by-sa/3.0/ -*/ -class Low_random { - - /** - * Plugin return data - * - * @var string - */ - var $return_data; + * < EE 2.6.0 backward compat + */ +if ( ! function_exists('ee')) +{ + function ee() + { + static $EE; + if ( ! $EE) $EE = get_instance(); + return $EE; + } +} - /** - * Set of items to choose from - * - * @var array - */ - var $set = array(); - - /** - * Debug mode - * - * @var bool - */ - var $debug = FALSE; +/** + * Low Random Plugin class + * + * @package low_random + * @author Lodewijk Schutte <hi@gotolow.com> + * @link http://gotolow.com/addons/low-nice-date + * @license http://creativecommons.org/licenses/by-sa/3.0/ + */ +class Low_random { // -------------------------------------------------------------------- + // PROPERTIES + // -------------------------------------------------------------------- /** - * PHP4 Constructor - * - * @see __construct() - */ - function Low_random() - { - $this->__construct(); - } - - // -------------------------------------------------------------------- + * Set of items to choose from + * + * @var array + */ + private $set = array(); /** - * PHP5 Constructor - * - * @return null - */ - function __construct() - { - /** ------------------------------------- - /** Get global instance - /** -------------------------------------*/ + * Debug mode + * + * @var bool + */ + private $debug = FALSE; - $this->EE =& get_instance(); - } - // -------------------------------------------------------------------- - + // METHODS + // -------------------------------------------------------------------- + /** * Randomize given items, pipe delimited * * @param string $str * @return string */ - function item($str = '') + public function item($str = '') { if ($str == '') { - $str = $this->EE->TMPL->fetch_param('items', ''); + $str = ee()->TMPL->fetch_param('items', ''); } - + $this->set = explode('|', $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- - + /** * Randomize tagdata * * @since 2.1 * @param string $str * @return string */ - function items($str = '') + public function items($str = '') { // get tagdata if ($str == '') { - $str = $this->EE->TMPL->tagdata; + $str = ee()->TMPL->tagdata; } - + // trim if necessary - if ($this->EE->TMPL->fetch_param('trim', 'yes') != 'no') + if (ee()->TMPL->fetch_param('trim', 'yes') != 'no') { $str = trim($str); } - + // get separator - $sep = $this->EE->TMPL->fetch_param('separator', "\n"); - + $sep = ee()->TMPL->fetch_param('separator', "\n"); + // create array from tagdata $this->set = explode($sep, $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- - + /** * Randomize the given letter range * * @param string $from * @param string $to * @return string */ - function letter($from = '', $to = '') + public function letter($from = '', $to = '') { // Parameters if ($from == '') { - $from = $this->EE->TMPL->fetch_param('from', 'a'); + $from = ee()->TMPL->fetch_param('from', 'a'); } - + if ($to == '') { - $to = $this->EE->TMPL->fetch_param('to', 'z'); + $to = ee()->TMPL->fetch_param('to', 'z'); } // no from? Set to a if (!preg_match('/^[a-z]$/i', $from)) { $from = 'a'; } - + // no to? Set to z if (!preg_match('/^[a-z]$/i', $to)) { $to = 'z'; } // fill set $this->set = range($from, $to); - + return $this->_random_item_from_set(); } // -------------------------------------------------------------------- - + /** * Random number between 2 values * * @param string $from * @param string $to * @return string */ - function number($from = '', $to = '') + public function number($from = '', $to = '') { // Parameters if ($from == '') { - $from = $this->EE->TMPL->fetch_param('from', '0'); + $from = ee()->TMPL->fetch_param('from', '0'); } - + if ($to == '') { - $to = $this->EE->TMPL->fetch_param('to', '9'); + $to = ee()->TMPL->fetch_param('to', '9'); } - + // no from? Set to 0 if (!is_numeric($from)) { $from = '0'; } - + // no to? Set to 9 if (!is_numeric($to)) { $to = '9'; } - + // return random number return strval(rand(intval($from), intval($to))); } // -------------------------------------------------------------------- - + /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ - function file($folder = '', $filter = '') + public function file($folder = '', $filter = '') { // init var $error = FALSE; - + // Parameters if ($folder == '') { - $folder = $this->EE->TMPL->fetch_param('folder'); + $folder = ee()->TMPL->fetch_param('folder'); } - + if ($filter == '') { - $filter = $this->EE->TMPL->fetch_param('filter', ''); + $filter = ee()->TMPL->fetch_param('filter', ''); } // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { // get server path from upload prefs - $this->EE->db->select('server_path'); - $this->EE->db->from('exp_upload_prefs'); - $this->EE->db->where('id', $folder); - $query = $this->EE->db->get(); + $query = ee()->db->select('server_path') + ->from('upload_prefs') + ->where('id', $folder) + ->get(); // Do we have a match? get path if ($query->num_rows()) { $folder = $query->row('server_path'); } } - + // Simple folder check if (!strlen($folder)) { $error = TRUE; } else { // check for trailing slash if (substr($folder, -1, 1) != '/') { $folder .= '/'; } } // Another folder check if (!is_dir($folder)) { $error = TRUE; } else { // open dir $dir = opendir($folder); // loop through folder while($f = readdir($dir)) { // no file? skip if (!is_file($folder.$f)) continue; // set addit to 0, check filters $addit = 0; // check if filter applies foreach ($filters AS $filter) { if (strlen($filter) && substr_count($f, $filter)) { $addit++; } } // if we have a match, add file to array if ($addit == count($filters)) { $this->set[] = $f; } } // close dir closedir($dir); } - + // return data return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); } - + // -------------------------------------------------------------------- - + /** * Display invalid folder if debug is on * * @param string $folder * @return string */ - function _invalid_folder($folder = '') + private function _invalid_folder($folder = '') { // return error message if debug-mode is on return $this->debug ? "{$folder} is an invalid folder" : ''; } // -------------------------------------------------------------------- - + /** * Random item from set (array) * * @return string */ - function _random_item_from_set() + private function _random_item_from_set() { return $this->set[array_rand($this->set)]; } // -------------------------------------------------------------------- - - /** - * Usage - * - * Plugin Usage - * - * @return string - */ - function usage() - { - ob_start(); - ?> - {exp:low_random:item items="item1|item2|item3"} - - {exp:low_random:items} - item 1 - item 2 - item 3 - {/exp:low_random:items} - - {exp:low_random:items separator=","} - item 1, item 2, item 3 - {/exp:low_random:items} - - {exp:low_random:number from="1" to="200"} - - {exp:low_random:letter from="A" to="F"} - - {exp:low_random:file folder="images" filter="masthead|.jpg"} - <?php - $buffer = ob_get_contents(); - - ob_end_clean(); - - return $buffer; - } - - // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */ \ No newline at end of file
EEHarbor/low_random
296e1d8046263ee5790b49bc9d01bf2723aa2cd2
Added readme
diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d8da93a --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# Low Random for ExpressionEngine 2 + +See [gotolow.com](http://gotolow.com/addons/low-random) for more info. \ No newline at end of file
EEHarbor/low_random
bdc815a1316b9fc26b2754980f9d69ee96ed4847
v2.1: added items() method
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php index 223cc62..a5774af 100644 --- a/low_random/pi.low_random.php +++ b/low_random/pi.low_random.php @@ -1,330 +1,372 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $plugin_info = array( 'pi_name' => 'Low Random', - 'pi_version' => '2.0', + 'pi_version' => '2.1', 'pi_author' => 'Lodewijk Schutte ~ Low', - 'pi_author_url' => 'http://loweblog.com/freelance/article/ee-low-random-plugin/', + 'pi_author_url' => 'http://loweblog.com/software/low-random/', 'pi_description' => 'Returns randomness', 'pi_usage' => Low_random::usage() ); /** * Low Random Plugin class * * @package low-random-ee2_addon -* @version 2.0 +* @version 2.1 * @author Lodewijk Schutte ~ Low <low@loweblog.com> -* @link http://loweblog.com/freelance/article/ee-low-random-plugin/ +* @link http://loweblog.com/software/low-random/ * @license http://creativecommons.org/licenses/by-sa/3.0/ */ class Low_random { /** * Plugin return data * * @var string */ var $return_data; /** * Set of items to choose from * * @var array */ var $set = array(); /** * Debug mode * * @var bool */ var $debug = FALSE; // -------------------------------------------------------------------- /** * PHP4 Constructor * * @see __construct() */ function Low_random() { $this->__construct(); } - + // -------------------------------------------------------------------- /** * PHP5 Constructor * * @return null */ function __construct() { /** ------------------------------------- /** Get global instance /** -------------------------------------*/ $this->EE =& get_instance(); } - + // -------------------------------------------------------------------- /** * Randomize given items, pipe delimited * * @param string $str * @return string */ function item($str = '') { if ($str == '') { $str = $this->EE->TMPL->fetch_param('items', ''); } $this->set = explode('|', $str); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- + /** + * Randomize tagdata + * + * @since 2.1 + * @param string $str + * @return string + */ + function items($str = '') + { + // get tagdata + if ($str == '') + { + $str = $this->EE->TMPL->tagdata; + } + + // trim if necessary + if ($this->EE->TMPL->fetch_param('trim', 'yes') != 'no') + { + $str = trim($str); + } + + // get separator + $sep = $this->EE->TMPL->fetch_param('separator', "\n"); + + // create array from tagdata + $this->set = explode($sep, $str); + + return $this->_random_item_from_set(); + } + + // -------------------------------------------------------------------- + /** * Randomize the given letter range * * @param string $from * @param string $to * @return string */ function letter($from = '', $to = '') { // Parameters if ($from == '') { $from = $this->EE->TMPL->fetch_param('from', 'a'); } if ($to == '') { $to = $this->EE->TMPL->fetch_param('to', 'z'); } // no from? Set to a if (!preg_match('/^[a-z]$/i', $from)) { $from = 'a'; } // no to? Set to z if (!preg_match('/^[a-z]$/i', $to)) { $to = 'z'; } // fill set $this->set = range($from, $to); return $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Random number between 2 values * * @param string $from * @param string $to * @return string */ function number($from = '', $to = '') { // Parameters if ($from == '') { $from = $this->EE->TMPL->fetch_param('from', '0'); } if ($to == '') { $to = $this->EE->TMPL->fetch_param('to', '9'); } // no from? Set to 0 if (!is_numeric($from)) { $from = '0'; } // no to? Set to 9 if (!is_numeric($to)) { $to = '9'; } // return random number return strval(rand(intval($from), intval($to))); } // -------------------------------------------------------------------- /** * Get random file from file system * * @param string $folder * @param string $filter * @return string */ function file($folder = '', $filter = '') { // init var $error = FALSE; // Parameters if ($folder == '') { $folder = $this->EE->TMPL->fetch_param('folder'); } if ($filter == '') { $filter = $this->EE->TMPL->fetch_param('filter', ''); } // Convert filter to array $filters = strlen($filter) ? explode('|', $filter) : array(); // is folder a number? if (is_numeric($folder)) { // get server path from upload prefs $this->EE->db->select('server_path'); $this->EE->db->from('exp_upload_prefs'); $this->EE->db->where('id', $folder); $query = $this->EE->db->get(); // Do we have a match? get path if ($query->num_rows()) { $folder = $query->row('server_path'); } } // Simple folder check if (!strlen($folder)) { $error = TRUE; } else { // check for trailing slash if (substr($folder, -1, 1) != '/') { $folder .= '/'; } } // Another folder check if (!is_dir($folder)) { $error = TRUE; } else { // open dir $dir = opendir($folder); // loop through folder while($f = readdir($dir)) { // no file? skip if (!is_file($folder.$f)) continue; // set addit to 0, check filters $addit = 0; // check if filter applies foreach ($filters AS $filter) { if (strlen($filter) && substr_count($f, $filter)) { $addit++; } } // if we have a match, add file to array if ($addit == count($filters)) { $this->set[] = $f; } } // close dir closedir($dir); } // return data return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); } // -------------------------------------------------------------------- /** * Display invalid folder if debug is on * * @param string $folder * @return string */ function _invalid_folder($folder = '') { // return error message if debug-mode is on return $this->debug ? "{$folder} is an invalid folder" : ''; } // -------------------------------------------------------------------- /** * Random item from set (array) * * @return string */ function _random_item_from_set() { return $this->set[array_rand($this->set)]; } // -------------------------------------------------------------------- /** * Usage * * Plugin Usage * * @return string */ function usage() { ob_start(); ?> {exp:low_random:item items="item1|item2|item3"} + + {exp:low_random:items} + item 1 + item 2 + item 3 + {/exp:low_random:items} + + {exp:low_random:items separator=","} + item 1, item 2, item 3 + {/exp:low_random:items} {exp:low_random:number from="1" to="200"} {exp:low_random:letter from="A" to="F"} {exp:low_random:file folder="images" filter="masthead|.jpg"} <?php $buffer = ob_get_contents(); ob_end_clean(); return $buffer; } // -------------------------------------------------------------------- } // END CLASS /* End of file pi.low_random.php */ \ No newline at end of file
EEHarbor/low_random
469fea09b45d1add69fe2358553f4e116ff50d34
v2.0: First commit
diff --git a/low_random/pi.low_random.php b/low_random/pi.low_random.php new file mode 100644 index 0000000..223cc62 --- /dev/null +++ b/low_random/pi.low_random.php @@ -0,0 +1,330 @@ +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); + +$plugin_info = array( + 'pi_name' => 'Low Random', + 'pi_version' => '2.0', + 'pi_author' => 'Lodewijk Schutte ~ Low', + 'pi_author_url' => 'http://loweblog.com/freelance/article/ee-low-random-plugin/', + 'pi_description' => 'Returns randomness', + 'pi_usage' => Low_random::usage() +); + +/** +* Low Random Plugin class +* +* @package low-random-ee2_addon +* @version 2.0 +* @author Lodewijk Schutte ~ Low <low@loweblog.com> +* @link http://loweblog.com/freelance/article/ee-low-random-plugin/ +* @license http://creativecommons.org/licenses/by-sa/3.0/ +*/ +class Low_random { + + /** + * Plugin return data + * + * @var string + */ + var $return_data; + + /** + * Set of items to choose from + * + * @var array + */ + var $set = array(); + + /** + * Debug mode + * + * @var bool + */ + var $debug = FALSE; + + // -------------------------------------------------------------------- + + /** + * PHP4 Constructor + * + * @see __construct() + */ + function Low_random() + { + $this->__construct(); + } + + // -------------------------------------------------------------------- + + /** + * PHP5 Constructor + * + * @return null + */ + function __construct() + { + /** ------------------------------------- + /** Get global instance + /** -------------------------------------*/ + + $this->EE =& get_instance(); + } + + // -------------------------------------------------------------------- + + /** + * Randomize given items, pipe delimited + * + * @param string $str + * @return string + */ + function item($str = '') + { + if ($str == '') + { + $str = $this->EE->TMPL->fetch_param('items', ''); + } + + $this->set = explode('|', $str); + + return $this->_random_item_from_set(); + } + + // -------------------------------------------------------------------- + + /** + * Randomize the given letter range + * + * @param string $from + * @param string $to + * @return string + */ + function letter($from = '', $to = '') + { + // Parameters + if ($from == '') + { + $from = $this->EE->TMPL->fetch_param('from', 'a'); + } + + if ($to == '') + { + $to = $this->EE->TMPL->fetch_param('to', 'z'); + } + + // no from? Set to a + if (!preg_match('/^[a-z]$/i', $from)) + { + $from = 'a'; + } + + // no to? Set to z + if (!preg_match('/^[a-z]$/i', $to)) + { + $to = 'z'; + } + + // fill set + $this->set = range($from, $to); + + return $this->_random_item_from_set(); + } + + // -------------------------------------------------------------------- + + /** + * Random number between 2 values + * + * @param string $from + * @param string $to + * @return string + */ + function number($from = '', $to = '') + { + // Parameters + if ($from == '') + { + $from = $this->EE->TMPL->fetch_param('from', '0'); + } + + if ($to == '') + { + $to = $this->EE->TMPL->fetch_param('to', '9'); + } + + // no from? Set to 0 + if (!is_numeric($from)) + { + $from = '0'; + } + + // no to? Set to 9 + if (!is_numeric($to)) + { + $to = '9'; + } + + // return random number + return strval(rand(intval($from), intval($to))); + } + + // -------------------------------------------------------------------- + + /** + * Get random file from file system + * + * @param string $folder + * @param string $filter + * @return string + */ + function file($folder = '', $filter = '') + { + // init var + $error = FALSE; + + // Parameters + if ($folder == '') + { + $folder = $this->EE->TMPL->fetch_param('folder'); + } + + if ($filter == '') + { + $filter = $this->EE->TMPL->fetch_param('filter', ''); + } + + // Convert filter to array + $filters = strlen($filter) ? explode('|', $filter) : array(); + + // is folder a number? + if (is_numeric($folder)) + { + // get server path from upload prefs + $this->EE->db->select('server_path'); + $this->EE->db->from('exp_upload_prefs'); + $this->EE->db->where('id', $folder); + $query = $this->EE->db->get(); + + // Do we have a match? get path + if ($query->num_rows()) + { + $folder = $query->row('server_path'); + } + } + + // Simple folder check + if (!strlen($folder)) + { + $error = TRUE; + } + else + { + // check for trailing slash + if (substr($folder, -1, 1) != '/') + { + $folder .= '/'; + } + } + + // Another folder check + if (!is_dir($folder)) + { + $error = TRUE; + } + else + { + // open dir + $dir = opendir($folder); + + // loop through folder + while($f = readdir($dir)) + { + // no file? skip + if (!is_file($folder.$f)) continue; + + // set addit to 0, check filters + $addit = 0; + + // check if filter applies + foreach ($filters AS $filter) + { + if (strlen($filter) && substr_count($f, $filter)) + { + $addit++; + } + } + + // if we have a match, add file to array + if ($addit == count($filters)) + { + $this->set[] = $f; + } + } + + // close dir + closedir($dir); + } + + // return data + return $error ? $this->_invalid_folder($folder) : $this->_random_item_from_set(); + } + + // -------------------------------------------------------------------- + + /** + * Display invalid folder if debug is on + * + * @param string $folder + * @return string + */ + function _invalid_folder($folder = '') + { + // return error message if debug-mode is on + return $this->debug ? "{$folder} is an invalid folder" : ''; + } + + // -------------------------------------------------------------------- + + /** + * Random item from set (array) + * + * @return string + */ + function _random_item_from_set() + { + return $this->set[array_rand($this->set)]; + } + + // -------------------------------------------------------------------- + + /** + * Usage + * + * Plugin Usage + * + * @return string + */ + function usage() + { + ob_start(); + ?> + {exp:low_random:item items="item1|item2|item3"} + + {exp:low_random:number from="1" to="200"} + + {exp:low_random:letter from="A" to="F"} + + {exp:low_random:file folder="images" filter="masthead|.jpg"} + <?php + $buffer = ob_get_contents(); + + ob_end_clean(); + + return $buffer; + } + + // -------------------------------------------------------------------- + +} +// END CLASS + +/* End of file pi.low_random.php */ \ No newline at end of file
simonwhitaker/goo-website
6e565335cc6ec76a85bdaf317d785be401fa73d2
Remove TypeKit fonts
diff --git a/src/content/css/base.css b/src/content/css/base.css index ebb699c..0907637 100644 --- a/src/content/css/base.css +++ b/src/content/css/base.css @@ -1,104 +1,105 @@ p, div, span, td, th, li { line-height: 1.3em; } body { - font-family: museo-sans, sans-serif; + font-family: Helvetica, Arial, sans-serif; margin: 0 auto; background-color: #aaa; color: #555; } p { line-height: 1.4em; } h1 { font-size: 32px; color: #000; } h2 { font-size: 22px; } h3 { font-size: 16px; } h1, h2, h3 { - font-family: rooney-web, sans-serif; + font-family: Helvetica, Arial, sans-serif; + font-weight: 200; } a[href] { color: #09f; } a:visited { color: #0F3D74; } /* Common bits and bobs ----------------------------------------*/ p img.icon[height="16"] { vertical-align: -2px; margin-right: 3px; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; color: #09f; } /* Tabs ----------------------------------------*/ ul.tabs li { list-style-type: none; } /* Content ----------------------------------------*/ #content { padding: 0 30px 20px 30px; } img.framed { border: 1px solid #ccc; padding: 3px; margin: 8px; } /* Footer ----------------------------------------*/ #footer { padding: 20px 30px; clear: left; color: #888; background-color: #f0f0f0; border-top: 1px solid #ddd; font-size: 11px; text-shadow: #fff 0 1px 1px; }
simonwhitaker/goo-website
c726dd7c1db1b928bc56db4af46154ee6ce47ade
Remove App Store link for xx app
diff --git a/src/content/index.yaml b/src/content/index.yaml index 9d47d9e..fa30173 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,80 +1,80 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Zippity" slug: zippity slogan: Put your zip in it itunes_url: http://itunes.apple.com/gb/app/zippity/id513855390?ls=1&mt=8 image: /images/apps/zippity.png description: - "The easiest way to handle zip files on your iOS device! View contents, send individual files by email, add images to your Camera Roll, and more." - "Handles .zip, .tar, .gz, .tar.gz." - "See <a href=\"http://www.zippityapp.co.uk\">www.zippityapp.co.uk</a>" client: Goo Software! This is one of our own. platform: "iPhone, iPad and iPod Touch" - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png accolades: - "Named by Apple as one of the <a href=\"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506\">best apps of 2011</a> in the UK App Store" description: - "Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university." - "Discover Oxford through the eyes of those who know it best, including Harry Potter!" client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png accolades: - "Winner, Charity and Voluntary Sector<br><a href=\"http://www.nmaawards.co.uk/winners2011.aspx\">NMA Awards 2011</a>" description: - "iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check." - "The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more." client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - "The ultimate karaoke experience for your iPad!" - "Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service." - "<a href=\"http://www.ikmultimedia.com/irigmic/features/\">iRig Mic</a> support means you don't have to use your hairbrush!" client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience - itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - "Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches." - "<span class=\"quotation\">&quot;An ingenious use of technology&quot;<span class=\"source\"> &mdash; The Guardian</span></span>" + - "<em>No longer on the App Store</em>" client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - "The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later." - "(Check out the RSAnimate category - they're <em>really</em> great!)" client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
af81d5657a9b8d8e83655449f417bdf8c08306b2
Add GooHub link
diff --git a/README.markdown b/README.markdown index b3ac914..b11c438 100644 --- a/README.markdown +++ b/README.markdown @@ -1,28 +1,28 @@ This is the code base for the Goo Software Ltd website ([www.goosoftware.co.uk](http://www.goosoftware.co.uk)). It uses [Nanoc](http://nanoc.stoneship.org/) to build the static site contents - check it out, it's really cool. # Installation gem install nanoc gem install rack gem install mime-types gem install kramdown gem install builder gem install rake gem install bundler - + gem install systemu # for rsync deployment # Compiling the site To compile once: nanoc co To test (runs a WEBBrick server and re-compiles every time a file changes): nanoc aco # Deployment rake deploy \ No newline at end of file diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..c804384 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1 @@ +crash.log diff --git a/src/lib/navlinks.rb b/src/lib/navlinks.rb index 1da2479..0dc6780 100644 --- a/src/lib/navlinks.rb +++ b/src/lib/navlinks.rb @@ -1,9 +1,9 @@ def navlinks return [ { :text => "Home", :url => "/" }, { :text => "Contact", :url => "/contact/" }, { :text => "About", :url => "/about/" }, - # { :text => "Help", :url => "/help/" }, + { :text => "GooHub", :url => "http://goosoftware.github.com/" }, { :text => "Blog", :url => "http://blog.goosoftware.co.uk/" }, ] end \ No newline at end of file
simonwhitaker/goo-website
81976889af7fbe0edeb573c995982953549f2a46
Fix issues with YAML content for index page
diff --git a/src/content/index.yaml b/src/content/index.yaml index 07ad103..9d47d9e 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,101 +1,80 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Zippity" slug: zippity slogan: Put your zip in it itunes_url: http://itunes.apple.com/gb/app/zippity/id513855390?ls=1&mt=8 image: /images/apps/zippity.png description: - - > The easiest way to handle zip files on your iOS device! - View contents, send individual files by email, add - images to your Camera Roll, and more. - - > Handles .zip, .tar, .gz, .tar.gz. - - > See <a href="http://www.zippityapp.co.uk">www.zippityapp.co.uk</a> + - "The easiest way to handle zip files on your iOS device! View contents, send individual files by email, add images to your Camera Roll, and more." + - "Handles .zip, .tar, .gz, .tar.gz." + - "See <a href=\"http://www.zippityapp.co.uk\">www.zippityapp.co.uk</a>" client: Goo Software! This is one of our own. platform: "iPhone, iPad and iPod Touch" - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png accolades: - - > Named by Apple as one of the - <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best - apps of 2011</a> in the UK App Store + - "Named by Apple as one of the <a href=\"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506\">best apps of 2011</a> in the UK App Store" description: - - > Oxford University's first official iPhone app takes you on - a guided tour of this beautiful city and its world-famous - university. - - > Discover Oxford through the eyes of those who know it best, - including Harry Potter! + - "Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university." + - "Discover Oxford through the eyes of those who know it best, including Harry Potter!" client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png accolades: - - > Winner, Charity and Voluntary Sector<br><a href="http://www.nmaawards.co.uk/winners2011.aspx">NMA Awards 2011</a> + - "Winner, Charity and Voluntary Sector<br><a href=\"http://www.nmaawards.co.uk/winners2011.aspx\">NMA Awards 2011</a>" description: - - > iBreastCheck from breast cancer charity Breakthrough helps - you to be breast aware with a little TLC: Touch, Look, Check. - - > The app has video and slideshow content explaining how to - check your breasts, a reminder service to help you to remember - to check regularly, and more. + - "iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check." + - "The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more." client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - - > The ultimate karaoke experience for your iPad! - - > Sing along to over 7,500 songs with this fun iPad - app from Lucky Voice, the UK's number one online - karaoke service. - - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> - support means you don't have to use your hairbrush! + - "The ultimate karaoke experience for your iPad!" + - "Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service." + - "<a href=\"http://www.ikmultimedia.com/irigmic/features/\">iRig Mic</a> support means you don't have to use your hairbrush!" client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - - > Using this fun and unique app, you and up to two friends can - play tracks from the xx's award-winning debut album <em>XX</em> - across multiple iPhones or iPod Touches. - - > <span class="quotation"> - &quot;An ingenious use of technology&quot; - <span class="source"> &mdash; The Guardian</span> - </span> + - "Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches." + - "<span class=\"quotation\">&quot;An ingenious use of technology&quot;<span class=\"source\"> &mdash; The Guardian</span></span>" client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - - > The RSA Vision app brings to you the latest videos from the - RSA's free public events programme. You can browse by category, - search for videos and compile a playlist of your favourite - videos to watch later. - - (Check out the RSAnimate category - they're <em>really</em> great!) + - "The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later." + - "(Check out the RSAnimate category - they're <em>really</em> great!)" client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
7d657dc596a075f14dfd4062b234da394cd0504f
Remove LinkedIn link
diff --git a/src/content/about.rhtml b/src/content/about.rhtml index cc295d7..7ec1900 100644 --- a/src/content/about.rhtml +++ b/src/content/about.rhtml @@ -1,21 +1,18 @@ <div id="content"> <h1> About Goo </h1> <img src="/images/simon.jpg" class="portrait" width="162" alt="Simon Whitaker"> <div class="biog"> <p> Goo Software Ltd is the creative brainchild of Simon Whitaker. </p> <p> Simon has a strong background in software development, having worked for a range of different companies, writing everything from embedded firmware that he debugged with an oscilloscope to distributed processing systems running on fleets of hardware spread across a continent. </p> <p> In 2010, Simon left his job as a Software Development Manager for Amazon.com to set up Goo Software Ltd. Simon prides himself on his great combination of top notch technical skills and an ability to speak plain English. At Goo, those skills help to offer our clients a strong, honest and dependable App development service. </p> - <p> - <a href="http://uk.linkedin.com/in/simonw"><img class="icon" src="/images/linkedin.png" width="16" height="16" alt="Linkedin" border="0"></a> <a href="http://uk.linkedin.com/in/simonw">Simon on LinkedIn</a> - </p> </div> <div style="clear:left"></div> </div>
simonwhitaker/goo-website
c8aa7d1ebd44da010794656829e7d9c7226ca242
Add redirects for blog
diff --git a/.gitignore b/.gitignore index 249e7ef..261cbef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store src/tmp/ html artwork/Goo product compositions/ +.rvmrc diff --git a/src/content/htaccess.txt b/src/content/htaccess.txt index 07c59da..c31181a 100644 --- a/src/content/htaccess.txt +++ b/src/content/htaccess.txt @@ -1 +1,19 @@ ErrorDocument 404 /error/404.html + +Redirect 301 /blog/uniqueidentifier-no-warnings/ http://blog.goosoftware.co.uk/2012/04/18/unique-identifier-no-warnings/ +Redirect 301 /blog/on-zippity/ http://blog.goosoftware.co.uk/2012/04/10/developing-zippity/ +Redirect 301 /blog/ios-photo-hierarchy/ http://blog.goosoftware.co.uk/2012/03/01/ios-photo-hierarchy/ +Redirect 301 /blog/xcode-git-revision/ http://blog.goosoftware.co.uk/ +Redirect 301 /blog/how-to-run-your-own-simple-git-server/ http://blog.goosoftware.co.uk/2012/02/07/quick-git-server/ +Redirect 301 /blog/dated-pdf-saver/ http://blog.goosoftware.co.uk/2012/02/02/save-to-dated-folder/ +Redirect 301 /blog/the-symbolicator-helps-those-who-help-themselves/ http://blog.goosoftware.co.uk/2011/03/30/Xcode4-symbolication-problems/ +Redirect 301 /blog/adding-state-to-nsurlconnection/ http://blog.goosoftware.co.uk/ +Redirect 301 /blog/debugging-in-analogue/ http://blog.goosoftware.co.uk/2010/11/08/debugging-in-analogue/ +Redirect 301 /blog/build-and-they-might-come/ http://blog.goosoftware.co.uk/2010/11/05/build-and-they-might-come/ +Redirect 301 /blog/site-construction-and-blogging-with-nanoc/ http://blog.goosoftware.co.uk/2010/10/20/nanoc/ +Redirect 301 /blog/iphone-developer-program-resetting-your-100-device-per-year-limit/ http://blog.goosoftware.co.uk/2010/09/06/device-limit/ +Redirect 301 /blog/spot-the-bug/ http://blog.goosoftware.co.uk/2010/08/24/spot-the-bug/ +Redirect 301 /blog/append-subversion-revision-to-an-iphone-apps-bundle-version-at-build-time/ http://blog.goosoftware.co.uk/ +Redirect 301 /blog/thoughts-on-the-app-store-review-process/ http://blog.goosoftware.co.uk/2010/07/24/app-store-review-process/ + +Redirect 301 /blog/ http://blog.goosoftware.co.uk/
simonwhitaker/goo-website
12d23024717102ba05724cde58ec12922be68089
Turn links in 'blog has moved' post into new-fangled 'hyperlinks'
diff --git a/src/content/blog/feed-has-moved.md b/src/content/blog/feed-has-moved.md index cf6cc6c..95417d7 100644 --- a/src/content/blog/feed-has-moved.md +++ b/src/content/blog/feed-has-moved.md @@ -1,7 +1,7 @@ --- kind: article created_at: 2012-04-18 title: This feed has moved! --- -This feed has moved - the blog is now located at http://blog.goosoftware.co.uk/ and the feed URL is http://blog.goosoftware.co.uk/atom.xml - see you there! \ No newline at end of file +This feed has moved - the blog is now located at [http://blog.goosoftware.co.uk/](http://blog.goosoftware.co.uk/) and the feed URL is [http://blog.goosoftware.co.uk/atom.xml](http://blog.goosoftware.co.uk/atom.xml) - see you there! \ No newline at end of file
simonwhitaker/goo-website
947810678668db3997baa7b72d1e148451e897b5
Move blog to blog.goosoftware.co.uk
diff --git a/src/content/blog.rhtml b/src/content/blog.rhtml deleted file mode 100644 index 7e34cd6..0000000 --- a/src/content/blog.rhtml +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: The Goo Software Geek Blog ---- - -<ul class="blog-items"> - <% for article in sorted_articles %> - <li> - <a href="<%= article.path %>"><%= article[:title] %></a> - <span class="date">(<%= article[:created_at]%>)</span> - </li> - <% end %> -</ul> diff --git a/src/content/blog/0001-app-store-review-process.md b/src/content/blog/0001-app-store-review-process.md deleted file mode 100644 index 125ab6c..0000000 --- a/src/content/blog/0001-app-store-review-process.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -kind: article -created_at: 2010-07-24 -title: Thoughts on the App Store review process ---- - -I've just completed the Apple Developer Program survey, and found that the process -really helped to focus my thoughts on the whole iOS development process, especially -the app submission and approval process. - -When I talk to clients and other iOS developers about iOS development, the App Store approval -process is raised time and again as a particular pain point. The two things that most bother -people trying to build a business around this platform are: - -1. The apparent arbitrariness around whether an app is approved or rejected -2. The lack of an SLA around approval times - -Regarding the former, I don't see this. The development agreement that iOS developers sign is -pretty explicit about what is and isn't allowed on the App Store. Most questions I've had around -whether feature X is permissible have been answered by reading the agreement. There have been some -[well-publicised examples](ex1) of rejections that appear to be arbitrary but they're few and -far between, and if often transpires that there's [more to the decision than is apparent at -first glance](ex2). - -[ex1]: http://daringfireball.net/2009/08/ninjawords -[ex2]: http://daringfireball.net/2009/08/phil_schiller_app_store - -Regarding the lack of SLA, it's definitely a real issue. The best Apple do is give an [indication](ap1) -of "Percentage of submissions reviewed within the last 7 days", broken down into New Apps and App -Updates. It's not even completely clear what this metric means, but it's the only thing we have. - -[ap1]: https://developer.apple.com/iphone/appstore/approval.html - -This means that, for developers hoping to target a particular app launch date, there's considerable -uncertainty around when the app needs to be submitted. One app we're working on currently is aimed -to coincide with a national event later this year and we can't afford to miss that window. But we -have no idea of when the app needs to be submitted in order to hit the window, so the best we can -do is guess and err generously on the side of caution - which in turn curtails the time we can -spend developing the app. - -## Can Apple do better? - -In order to answer that we first have to understand why the process is currently so unpredictable. -Apple have no control over the rate at which apps are submitted to the App Store, and I suppose -they'd argue that they do the best they can given that uncertainty. They will undoubtedly see -periods of peak demand where even a significantly larger review team would fall behind. -They can't guarantee an SLA given such unpredictability. - -Fair enough, you might think. But is it? There are a couple of factors that suggest Apple could -do better. - -### Apple knows how many developers it has - -All iOS developers are registered with Apple. Apple knows the size of the developer community at -and point in time, which should at least give a rough and ready metric on predicted App Store inflow. - -### Apple itself often triggers the periods of peak demand - -Those percentages I mentioned earlier tend to dip (indicating higher latency in the approval process) -when Apple release a new device (the iPad for example, or the iPhone 4) and developers rush to -submit apps targetting the new device. The same is true of major iOS upgrades. You may have noticed -a significant increase in the number of app updates in the App Store in the weeks after the iPhone 4 -and iOS4 were released as developers updated their apps with high resolution artwork and recompiled -under SDK 4 to take advantage of fast app switching. - -**Apple controls these hardware and software releases**; it knows they're coming and can plan for -them. And part of that plan should be increased capacity of the App Store review team. - -So here's what I'd like to see: Apple giving developers a guaranteed SLA for app submissions. -For example, Apple guarantee all apps will be reviewed within 7 days. This means Apple has to provide -the necessary capacity at their end to cope with peak demand and still meet SLA. That's a reasonable -burden on Apple I think; they are after all enjoying unprecedented (and well-deserved) success with -the App Store - but iOS developers are the geese laying the golden eggs and Apple needs to step up -and offer them a solid foundation on which they can build their businesses as successfully as Apple has -built its own. - -Consider the difference this would make to developers and their clients. - -**Today's situation** - -Client: "We need the app live by 28 September. When do we need to submit to the App Store?" - -Developer: "Well, no-one really knows. It we submit on 21 September then we've currently got -an 85% chance of going live on 28 September. Submitting earlier than that increases our -chances, but we don't know how much earlier we need to submit in order to guarantee going -live on 28 September. So let's submit on 7 September - surely it can't take any longer than -3 weeks?" - -**The situation with an SLA** - -Client: "We need the app live by 28 September. When do we need to submit to the App Store?" - -Developer: "21 September" - diff --git a/src/content/blog/0002-subversion-rev.md b/src/content/blog/0002-subversion-rev.md deleted file mode 100644 index 220d7a0..0000000 --- a/src/content/blog/0002-subversion-rev.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -kind: article -created_at: 2010-08-03 -title: Append Subversion revision to an iPhone app’s bundle version at build time ---- - -Here's a dirty hack to append the current Subversion revision to the version number of an iPhone app -automatically at build time. If your Info.plist specifies the version as 1.0 and your local Subversion -repository is at revision 36, the version number in your compiled app will be 1.0.36. - -To use: - -1. In Xcode control-click your target and choose Add > New Build Phase > New Run Script Build Phase - -2. Leave shell set to /bin/sh. Copy the code below (or grab from [gist](http://gist.github.com/506429)) and paste it into the Script panel - -3. Close the dialog - -4. Drag the new build phase action so that it appears first in the list of build actions - -5. Build your app - -Here's the code: - - # Get location of unparsed Info.plist - GS_INFO_PLIST_INPUT=$(basename "$INFOPLIST_FILE" .plist) - - # Get location of parsed Info.plist - GS_INFO_PLIST_PATH="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/Info" - - # Get version number from unparsed Info.plist - GS_VERSION=$(defaults read "$PROJECT_DIR/$GS_INFO_PLIST_INPUT" CFBundleVersion) - - # Append local SVN revision number - export GS_NEW_VERSION=$GS_VERSION.$(svnversion) - echo Version is $GS_NEW_VERSION - - # Write new version number to parsed Info.plist - defaults write "$GS_INFO_PLIST_PATH" CFBundleVersion $GS_NEW_VERSION - -This is a bit of a dirty one, but it works for me. If you have suggested improvements I'm all ears so please -leave a comment. - -For more on the output of svnversion, run: - - $ svnversion --help diff --git a/src/content/blog/0003-spot-the-bug.md b/src/content/blog/0003-spot-the-bug.md deleted file mode 100644 index 87140a9..0000000 --- a/src/content/blog/0003-spot-the-bug.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -kind: article -created_at: 2010-08-24 -title: Spot the bug ---- - -This code is supposed to show an instructions view when you rotate from landscape to portrait, but sometimes it doesn't quite perform as expected. Can you see why? - - - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation - { - if (UIInterfaceOrientationIsLandscape(fromInterfaceOrientation)) { - // Fade in instructions - [self setInstructionsOpacity:1.0 overTime:0.5]; - } - } \ No newline at end of file diff --git a/src/content/blog/0004-device-limit.md b/src/content/blog/0004-device-limit.md deleted file mode 100644 index b2c8453..0000000 --- a/src/content/blog/0004-device-limit.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -kind: article -created_at: 2010-09-06 -title: "iPhone Developer Program: Resetting your 100 device-per-year limit" ---- - -From [https://developer.apple.com/support/ios/program-renewals.html](https://developer.apple.com/support/ios/program-renewals.html) - - one to watch out for when you renew your iPhone Developer Program membership: - -<blockquote>When Team Agents or Admins first log into the iOS Provisioning Portal at the start of a new membership year, they will be presented with the option to remove devices and restore the device count for those removed devices. <strong>Important Note: Devices can be removed and their device count restored only up until the first new device is added.</strong> Therefore, it is important to remove all devices you are no longer using for development prior to adding any new devices.</blockquote> - diff --git a/src/content/blog/0005-nanoc.md b/src/content/blog/0005-nanoc.md deleted file mode 100644 index 950be05..0000000 --- a/src/content/blog/0005-nanoc.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: Site construction and blogging with nanoc -kind: article -created_at: 2010-10-20 ---- - -Since its inception, the Goo Software website has been written as static HTML and the -blog's been running on a Wordpress installation. It's worked fine but I've never been -happy with the setup. On the blog side, Wordpress is OK but heavyweight for our modest -needs, and on the main site maintaining everything as static HTML is a pain. Even with -only a few pages there's a load of boilerplate code that needs to be kept in sync -across pages, and on the front page there's a load of duplicate code around the -portfolio. - -I'd toyed with the idea of using [Django][django] to run the site, which would allow me -to use Django's templates system to share boilerplate code across pages, and Django's -ORM to model stuff like apps for the portfolio, but that's getting seriously heavyweight -for a site that seldom changes. I needed something in between static and Django. And then -I found [nanoc][nanoc]. - -## What is nanoc? - -nanoc is "a Ruby site compiler that generates static HTML". In essence, you provide content -as *layouts* (templates) and *items* (pages), and nanoc uses those building blocks to -generate your site. The back end strikes just the right balance between flexibility and -simplicity, and it's nicely extensible so you're only a few lines of Ruby away from any -missing functionality that you can't do without. - -## Basic workflow - -Using nanoc is really easy. Page content can be specified in a number of different formats, -(I tend to use HTML for the regular website and Markdown for blog posts). You edit your page -content then at the command line, type: - - $ nanoc compile - -That compiles your nanoc source into your final, static web content. You can preview the -build locally and when you're ready, deploy it as you would any static web content, e.g. -using FTP. nanoc has built-in support for rsync so if your server supports it you can deploy -your site without even having to fire up your favourite FTP client. Just add the deploy details -to your site's config (which is written in YAML), for example: - - deploy: - default: - dst: "goosoft@goosoftware.co.uk:~/goosoftware.co.uk" - -Then deploy with Rake: - - $ rake deploy:rsync - -## Case study: the Goo Software portfolio - -Have a look on the [Goo front page][goo] and you'll see our funky portfolio showing some of the -cool apps we've worked on recently. Have a look at the page source and you'll see it's basically -a load of divs with the same internal structure, one for each app. And that static HTML is exactly -how we used to code it - copying and pasting the div each time we added a new app. - -Here's how we achieve the same thing using nanoc. In the config for the index page, we've got this: - - apps: - - name: RSA Vision - slogan: Enlightenment to go - itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 - image: /images/apps/rsa-vision.png - description: - - > The RSA Vision app brings to you the latest videos from the - RSA's free public events programme. You can browse by category, - search for videos and compile a playlist of your favourite - videos to watch later. - - (Check out the RSAnimate category - they're <em>really</em> great!) - client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> - platform: iPhone and iPod Touch - - - name: iBreastCheck - slogan: Helping you to be breast aware - itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 - image: /images/apps/ibreastcheck.png - description: - - > iBreastCheck from breast cancer charity Breakthrough helps - you to be breast aware with a little TLC: Touch, Look, Check. - - > The app has video and slideshow content explaining how to - check your breasts, a reminder service to help you to remember - to check regularly, and more. - client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> - platform: iPhone and iPod Touch - -Then in the HTML, we've got this: - - <% for app in @item[:apps]%> - <div class="app" id="<%= app[:name].downcase.gsub(' ','-') %>"> - <h2> - <a href="<%= app[:itunes_link] %>"><%= app[:name] %></a> - <span class="appslogan"><%= app[:slogan]%></span> - </h2> - <a href="<%= app[:itunes_link] %>"> - <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> - </a> - <div class="description"> - <% for desc in app[:description]%> - <p><%= desc %></p> - <% end %> - - <div class="appstore-badge"> - <a href="<%= app[:itunes_link] %>"> - <img src="/images/app-store-badge-clipped.png" alt="App Store Badge Clipped" border="0"> - </a> - </div> - <% if app[:client] %> - <div class="detail">Client: <%= app[:client] %></div> - <% end %> - <% if app[:platform] %> - <div class="detail">Platform: <%= app[:platform] %></div> - <% end %> - </div> - <div class="app-end"></div> - </div> - <% end %> - -If you're interested in using nanoc yourself and you're the sort of person who learns best -by example, you can find the complete source for this site (including the blog) -[on GitHub][goo-on-github]. - - -[django]: http://www.djangoproject.com/ -[nanoc]: http://nanoc.stoneship.org/ -[goo-on-github]: http://github.com/simonwhitaker/goo-website -[goo]: http://www.goosoftware.co.uk/ \ No newline at end of file diff --git a/src/content/blog/0006-build-and-they-might-come.md b/src/content/blog/0006-build-and-they-might-come.md deleted file mode 100644 index 6ac2828..0000000 --- a/src/content/blog/0006-build-and-they-might-come.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Build and they might come -kind: article -created_at: 2010-11-05 ---- - -<blockquote>We’re making iPhone software primarily for three reasons</blockquote> - -[Great article][1] from Marco Arment about why just building a new hardware -platform won't in and of itself cause developers to flock to it. - -[1]: http://www.marco.org/1483805627 \ No newline at end of file diff --git a/src/content/blog/0007-debugging-in-analogue.md b/src/content/blog/0007-debugging-in-analogue.md deleted file mode 100644 index 5045473..0000000 --- a/src/content/blog/0007-debugging-in-analogue.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -kind: article -created_at: 2010-11-08 -title: Debugging in analogue ---- - -One of the most interesting challenges of our recently-launched [app for The xx][appstore1] was getting the video -synchronisation as tight as possible across multiple devices. The app uses a bit of clever logic to determine, to -the best of its ability, the clock offsets between the various devices. The device that's playing server then uses -that to send a trigger signal to all the devices (including itself), saying "start playing at exactly time *t*" - -where t is adjusted for each device based on its clock offset so that all devices get the same relative trigger -time. - -For example, imagine two devices, D1 and D2. D2's clock is 2 seconds ahead of D1's clock - so when D1 thinks it's -12:00:00, D2 thinks it's 12:00:02. Once the devices are aware of this discrepancy they can compensate for it: D1 -might tell itself "start playing at 13:30:00" while telling D2 "start playing at 13:30:02". The effect is that both -devices start playing at the same time. - -At least, that's the theory. In practice, iOS is a non-deterministic, multitasking operating system, and it's quite -possible that at the alloted time it'll be busy refreshing the UI, checking for mail, or doing any number of other -things. By the time the thread that's going to hit play on the video gets serviced the devices might have slipped -significantly out of sync. - -There's no way around this, and occasionally the syncing isn't perfect (especially on older iPhone and iPod models), -but you can mitigate the effect by having each device spin up a new, high-priority thread when they receive the -play signal, and have this high-priority thread start the video at the alloted time. - -In iOS there are a number of ways of starting new threads, including [NSThread][api-nsthread], -[NSOperationQueue][api-nsop] and [Grand Central Dispatch][api-gcd]. I was curious to know which of these methods -yielded the most favourable results for our app. So, I set up a test scenario with a difference. - -First, using [Amadeus Pro][amadeus-pro] I created a WAV file containing a single, 100Hz square wave. Then I -inserted this sound at the start of the soundtrack of a sample video. I loaded a test app that played the sample -video onto a pair of iPod Touch 3Gs and using some audio splitters and cables, connected the iPods to the line-in -on my MacBook Pro such that one iPod contributed the left channel and the other the right. It looked something -like this: - -<img class="framed" title="Sync test hardware setup" src="/images/blog/sync-test-hardware-setup.jpg" alt="" /> - -Then, once again in Amadeus Pro, I hit record, then hit play in my test app. Once the square wave had played I could -stop recording, zoom in on the audio track I'd just recorded, and look at the distance between the falling edge of the -square wave on the two channels to see the time lag between the two videos: - -<img class="framed" title="Sync test screenshot" src="/images/blog/sync-test-screenshot.png" alt="" /> - -I repeated the experiment a number of times with each threading approach and compared the figures to make sure I was -choosing the best option. Average time delay per method was as follows: - -<table> - <thead> - <tr><th>Method</th><th>Average time delay (ms)</th></tr> - </thead> - <tbody> - <tr><td>Schedule play on the main thread</td><td>114</td></tr> - <tr><td>NSOperationQueue</td><td>7</td></tr> - <tr><td>Grand Central Dispatch</td><td>9</td></tr> - <tr><td>NSThread</td><td>10</td></tr> - </tbody> -</table> - -So, perhaps as expected, there's not much to choose between the three threading architectures I tried, although -they all give performance that's an order of magnitude better than the performance you get if you schedule the -play signal on the main thread. - -[appstore1]: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 -[api-nsthread]: http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSThread_Class/Reference/Reference.html -[api-nsop]: http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html -[api-gcd]: http://developer.apple.com/iphone/library/documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html -[amadeus-pro]: http://www.hairersoft.com/AmadeusPro/AmadeusPro.html \ No newline at end of file diff --git a/src/content/blog/0008-NSURLConnection.md b/src/content/blog/0008-NSURLConnection.md deleted file mode 100644 index af1d194..0000000 --- a/src/content/blog/0008-NSURLConnection.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -kind: article -created_at: 2010-11-21 -title: Adding state to NSURLConnection ---- - -Here's a quick and simple way of adding state to NSURLConnection objects. - -If you've ever written Cocoa code to talk to a remote HTTP server, you've -probably used `NSURLConnection`. The basic use case looks something like this. -First you instantiate an NSURLConnection using an NSURLRequest object: - - NSURLConnection* conn = [[NSURLConnection alloc] initWithRequest:someRequest delegate:self]; - [conn release]; - -Then elsewhere you write delegate methods to handle callbacks from the connection such as -`connection:didReceiveData:` when the delegate receives data from the connection, -`connectionDidFinishLoading:` when the connection has finished loading, or -`connection:didFailWithError:` if it fails. - -The tricky thing there is: if I instantiate more than one NSURLConnection object, how do I know -which connection the delegate methods are being called for? (If you're telling yourself it's OK, -my code doesn't instantiate more than one NSURLConnection object at a time, ask yourself: can I -**guarantee** that my code will **never** have more than one NSURLConnection live at any one time? If you -can't, read on...) - -Here's what I'd like to be able to do in `connection:didReceiveData:`, for example: - - -(void) connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { - // buffers is an NSDictionary of previously instantiated NSMutableData - // objects, one per connection - NSMutableData *buffer = [buffers objectForKey:[connection uniqueId]]; - [buffer appendData:data]; - } - -But sadly, the `uniqueId` method on NSURLConnection doesn't exist, and there isn't any other -similar functionality available in NSURLConnection. - -So I decided to solve the problem by adding an instance variable to NSURLConnection. You -can add methods to existing classes using categories, but to add an instance variable you -need to subclass. Here's all you need to do: - - @interface GSURLConnection : NSURLConnection { - NSDictionary *userInfo; - } - - @property (nonatomic, retain) NSDictionary *userInfo; - - @end - - @implementation GSURLConnection - - @synthesize userInfo; - - @end - -This gives you an instance variable `userInfo` that you can use to store all sorts of -additional state in a key/value stylee. Then when you create a connection, use this: - - GSURLConnection *conn = [[GSURLConnection alloc] initWithRequest:req - delegate:self - startImmediately:NO]; - - NSString *uniqueId = myUniqueIdGenerator(); - NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - uniqueId, - @"uniqueId", - nil]; - - // Create an empty data buffer for this connection - [buffers setObject:[NSMutableData dataWithCapacity:256] - forKey:uniqueId]; - - conn.userInfo = userInfo; - [conn scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; - [conn start]; - [conn release]; - -Then in your delegate methods, you do stuff like this: - - - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - NSString *key = [((GSURLConnection*)connection).userInfo objectForKey:@"uniqueId"]; - [[buffers objectForKey:key] appendData:data]; - } - - - - (void)connectionDidFinishLoading:(NSURLConnection *)connection { - NSString *key = [((GSURLConnection*)connection).userInfo objectForKey:@"uniqueId"]; - NSData *rawData = [buffers objectForKey:key]; - [buffers removeObjectForKey:key]; - - // do stuff with rawData - } - -Simple! - -I'm sure there are loads of ways to improve this - if you know one, add a comment! diff --git a/src/content/blog/0009-Xcode4-symbolication-problems.md b/src/content/blog/0009-Xcode4-symbolication-problems.md deleted file mode 100644 index 1a6b174..0000000 --- a/src/content/blog/0009-Xcode4-symbolication-problems.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -kind: article -created_at: 2011-03-30 -title: The symbolicator helps those who help themselves ---- - -It sounds like [I'm not the only one][so1] having problems with Xcode 4 not -symbolicating crash logs correctly. Here's the symptom: I drag crash logs that -testers email me into Xcode 4's organiser, then sit and wait for symbolication to -complete. But once it's done, my logs aren't symbolicated - they still just show -a load of memory locations. - -Running the symbolicator at the command line sheds a bit of light on what's going -wrong: - - $ /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks\ - > /DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash MyApp_etc.crash - -Here's the output I get: - - Can't understand the output from otool ( -> '\/Developer\/Platforms\/ - iPhoneOS\.platform\/Developer\/usr\/bin\/otool -arch armv7 -l - /Users/simon/Library/Developer/Xcode/DerivedData/MyApp-fbxifqioardhgxaitjdftgoejjzz/ - Build/Products/Debug-iphonesimulator/MyApp.app/MyApp') at - /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/ - DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash line 323. - -Hmm... Notice that path to the app? - -**~/Library/Developer/Xcode/&#x200b;DerivedData/MyApp-fbxifqioardhgxaitjdftgoejjzz/&#x200b;Build/Products/Debug-iphonesimulator/&#x200b;MyApp.app/MyApp** - -That's not the right app file - it's the build output from a Debug build, not an -AdHoc build, and worse it's a Debug build for the iOS simulator. - -As you may know, the symbolicator uses Spotlight to find the .app file (and the .dSYM file) -it uses to symbolicate a log. And that means that there's a really simple fix. -Adding **~/Library/Developer/Xcode/DerivedData/** to the list -of directories that Spotlight doesn't index makes those build artefacts invisible to -Spotlight, and hence the symbolicator. Just open System Preferences, click on -Spotlight, switch to the Privacy tab and add that DerivedData folder to the list. - -You may now find that the symbolicator has a similar problem with apps installed on -the iPhone simulator itself. Adding **~/Library/Application Support/iPhone Simulator/** to -Spotlight's ignore list nails that one. - -<img title="Spotlight settings" src="/images/blog/spotlight-symbolicator.png" alt="" /> - -Now when I run the symbolicator at the command line, I get properly symbolicated -output, just as expected. - -**UPDATE**: See the comments on [this Stack Overflow answer][so2] of mine. This solution -is not without its gotchas; it can interfere with correct running of the Instruments app. - -[so1]: http://stackoverflow.com/questions/5458573/xcode-4-failure-to-symbolicate-crash-log/5491334 -[so2]: http://stackoverflow.com/questions/5458573/xcode-4-failure-to-symbolicate-crash-log/5491334#5491334 \ No newline at end of file diff --git a/src/content/blog/0010-save-to-dated-folder.md b/src/content/blog/0010-save-to-dated-folder.md deleted file mode 100644 index 56e9d5c..0000000 --- a/src/content/blog/0010-save-to-dated-folder.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -kind: article -created_at: 2012-02-02 -title: Dated PDF Saver ---- - -**Update (29/2/12): Script tweaked to make sure that it generates a unique target filename rather than overwriting existing contents in the target directory.** (See updated code below. If you've got the version with the `unique_path` function you're good to go.) - -Here's a nifty script I use to save emailed receipts as PDFs in a folder -hierarchy that includes the date (year and month) on which they were saved. -It helps keep my business receipts organised and saves me a bit of time -when I'm looking for receipts after the event. Hopefully you might find it -useful too. It's on Github so feel free to clone, tweak and share. - -(Don't ask about the license. It's a 2-line shell script with 65 lines -of comments and context. It's free, in every possible sense of the word.) - -<script src="https://gist.github.com/1722378.js"> </script> -<noscript><a href="https://gist.github.com/1722378">https://gist.github.com/1722378</a></noscript> \ No newline at end of file diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md deleted file mode 100644 index cdcb5f0..0000000 --- a/src/content/blog/0011-quick-git-server.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -kind: article -created_at: 2012-02-07 -title: Running a simple Git server using SSH -slug: how-to-run-your-own-simple-git-server ---- - -I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be both easy and useful, so I thought I'd document how I did it. - -Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. - -## What I wanted - -I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: - - git@github.com:simonwhitaker/PyAPNs.git - -Then I'll clone that remote by running: - - git clone git@github.com:simonwhitaker/PyAPNs.git - -and away I go. So, the question was: how do I create a remote on my own device and access it in the same way? - -## Unpicking the SSH notation - -It's helpful to first understand what the SSH notation actually means. It's really simple. The basic format is: - - [username]@[hostname]:[path to repository] - -That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. - -Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. - -So, here's what I had to do to set up a git server on my Mac mini: - -1. Create a new user called git -2. Set up passwordless SSH so that I can connect to my git user's account without a password -3. Create a directory in git's home directory for storing my repositories -4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. - -## Step 1: Create the git user - -The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges; a plain old user account will do fine. - -For the sake of simplicity, on the server (running OS X, remember) I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. - -(That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you're using OS X and you want to create a user who doesn't appear in the login screen, see [this Super User answer](http://superuser.com/a/268441/62672) for details.) - -## Step 2: Set up passwordless SSH - -On my laptop I opened a terminal window and checked to see if I had a current public SSH key: - - $ ls ~/.ssh/id_rsa.pub - -I did. (If you don't have one, you can create a new public/private key pair by running `ssh-keygen` and following the prompts.) - -Next I copied my public key to the git user's home directory on the server, like this: - - $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: - -When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: - - $ ssh git@Goo-mini.local - -Again, I entered the git user's password when prompted. - -Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. - - $ mkdir -p .ssh - $ cat id_rsa.pub >> .ssh/authorized_keys - -Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. - - $ chmod 700 .ssh - $ chmod 400 .ssh/authorized_keys - -That's it, passwordless-SSH is now set up. If you're following along at home you can try it for yourself: log out of the server then log back in: - - $ ssh git@[your server name] - -You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. - -## Step 3: Create a directory in git's home directory for storing my repositories - -Logging in to the server once again as git, I created a directory called simon in git's home directory. - - $ ssh git@Goo-mini.local - $ mkdir simon - -Simple. - -## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. - -This one was pretty simple, too. First I created a directory to hold the repository. I followed Github's convention and named the directory as [project name].git: - - $ ssh git@Goo-mini.local - $ mkdir simon/myproject.git - -Finally, I initialised a bare Git repository in that directory: - - $ cd simon/myproject.git - $ git init --bare - -Note the `--bare` option to `git init`: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. - -## Trying it out - -All that was left was to push my repository to my new git server. On my laptop I ran the following: - - $ cd /path/to/git/repo - $ git remote add origin git@Goo-mini.local:simon/myproject.git - $ git push origin master - Counting objects: 3, done. - Writing objects: 100% (3/3), 232 bytes, done. - Total 3 (delta 0), reused 0 (delta 0) - To git@Goo-mini.local:simon/myproject.git - * [new branch] master -> master - -Cooooool! - -## Next steps - -There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. - -If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is... you guessed it... [on Github](https://github.com/simonwhitaker/goo-website/blob/master/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file diff --git a/src/content/blog/0012-xcode-git-revision.md b/src/content/blog/0012-xcode-git-revision.md deleted file mode 100644 index b92cefc..0000000 --- a/src/content/blog/0012-xcode-git-revision.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -kind: article -created_at: 2012-02-08 -title: Append Git revision to an app’s bundle version at build time -slug: xcode-git-revision ---- - -A while ago I blogged a [dirty hack](/blog/append-subversion-revision-to-an-iphone-apps-bundle-version-at-build-time/) -to append the current Subversion revision to the version number of an iPhone app -automatically at build time. Well, I haven't used Subversion for a while now, -having experienced a Damascene conversion to Git last year. - -So, here's the same hack, but updated for Git. This time it's even more hacky because, -unlike Subversion, Git doesn't assign linear revision numbers every time you check code -in. If you think of a typical Git branching graph that makes sense. So this hack -uses `git describe` and then carves up the output to create its pseudo-version number. -It's dirty, but it does the trick. - -To use: - -1. In Xcode 4, click on your project file (the one with the blue icon) in the Project Navigator -2. Click Build Phases -3. Click the Add Build Phase at the bottom of the screen and choose Add Run Script -4. Leave the shell set as /bin/sh. Copy the code below and paste it into the script panel -5. Build your app - -Here's the code: - -<script src="https://gist.github.com/1770898.js?file=git-version.sh"></script> -<noscript><a href="https://gist.github.com/1770898">https://gist.github.com/1770898</a></noscript> - -This is a bit of a dirty one, but it works for me. If you have suggested improvements I'm all ears so please -leave a comment. - diff --git a/src/content/blog/0013-ios-photo-hierarchy.md b/src/content/blog/0013-ios-photo-hierarchy.md deleted file mode 100644 index fa05734..0000000 --- a/src/content/blog/0013-ios-photo-hierarchy.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -kind: article -created_at: 2012-03-01 -title: The hierarchy in iOS 5's photo library -slug: ios-photo-hierarchy ---- - -I finally had a need to get my head around the complex hierarchy of photos in iOS's Photos app, and how they mapped to the flatter hierarchy in the iOS photo picker control. Here are the fruits of my labour - hope you find them helpful. (Click the image for a large version.) - -[![Photo organisation in iOS 5.0][img-thumb]][img-large] - -[img-thumb]: http://f.cl.ly/items/1t2F1O0L0c05001J0Y24/ios-photo-hierarchy-thumb.png -[img-large]: http://f.cl.ly/items/1P2L2a240Z0G3i400H06/ios-photo-hierarchy.png \ No newline at end of file diff --git a/src/content/blog/0014-developing-zippity.md b/src/content/blog/0014-developing-zippity.md deleted file mode 100644 index 57f564a..0000000 --- a/src/content/blog/0014-developing-zippity.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -kind: article -created_at: 2012-04-10 -title: On Zippity – notes from a small iPhone app -slug: on-zippity ---- - -[Zippity](http://www.zippityapp.co.uk/) hit the App store last week. It's a simple utility app for opening zip files, and I'm very proud of it. That's no mistake; from day one I worked hard to *make sure* Zippity would be an app I was proud of. Here are a few of the decisions I made along the way. - -## Zippity uses standard UI elements - -To some, standard UI elements might seem like the lazy option, but for me there's always a strong urge to be creative and create some fun little widgets to make an app stand out. It's a truth universally acknowledged that every iOS developer secretly wants to work for [Tapbots](http://www.tapbots.com). :-) - -For a utility app like Zippity though, I didn't feel there was any room for unorthodox UI elements. This isn't an app that people will live in day in, day out. It's an app that most people will only use occasionally, and for those users it's going to be a pain if every time they open the app they have to re-learn how to use it. So, my first rule was: no custom UI elements where there's a UIKit alternative. - -On a similar note, I also didn't want functionality that could only be accessed by gestures. Gestures offer developers a nice way to add "power user" features, but Zippity is built from the ground up to make all of its functionality obvious to casual users. - -## Zippity doesn't want to be your friend - -Zippity won't ask you to like it on Facebook, rate it on the App Store or recommend it to your friends. I don't like apps that nag me for my approval (even though I understand why they do it), so Zippity doesn't do that. This might mean I die a penniless failure while other app developers enjoy the rich rewards of tapping into the social graph, but I'm fine with that. At least I'll never be remembered as the guy who wrote that needy zip file app. - -## Zippity makes sensible choices about what to show you and how to show it - -By default, Zippity doesn't show file extensions (although you can change that if you really want to). Instead, the icon next to a file generally shows what sort of file it is. (For visually impaired users however, Zippity does speak the file extension, since those icons are only useful clues for sighted users.) - -When showing you the contents of a zip file with multiple nested, otherwise-empty folders, Zippity collapses those folders down. For example, if the physical structure of the unzipped contents looks like this: - -![Illustration of Zippity's physical folder structure](/images/blog/zippity-folder-structure-physical.png) - -Zippity will present a logical view that looks like this: - -![Illustration of Zippity's logical folder structure](/images/blog/zippity-folder-structure-logical.png) - -## Zippity talks your language - -I've tried to avoid technical language wherever possible in Zippity's interface and associated user-facing content. For example in its App Store description, on the Zippity website and anywhere else you see blurb about Zippity it talks about being an app for opening "zip files". In fact Zippity handles a number of other archive formats, more geeky stuff like .tar, .gz and .bzip2, but I use the term "zip files" to cover all these archive formats. While that's technically incorrect, it's the terminology that makes sense to most people. - -Zippity talks your language in another way too; if you're a Dutch or Hungarian speaker then Zippity 1.0.1 (currently awaiting App Store approval) has an interface completely translated into your mother tongue. Other translations are coming soon! (If you're interested in helping to translate Zippity into your language please [get in touch](http://twitter.com/s1mn).) - -## Zippity looks nice - -Even utility apps can look nice, and Zippity's no exception. It has a great icon (and another great, bespoke document icon) created by my friend and iconic iconographer, [Jon Hicks](http://twitter.com/hicksdesign). A different navigation bar colour and a subtle background from [subtlepatterns.com](http://subtlepatterns.com) in the "About Zippity" view give it a distinct visual identity and help to ensure that it can't be mistaken at a glance for Zippity's main view (i.e. the contents of a zip file). \ No newline at end of file diff --git a/src/content/blog/0015-unique-identifier-no-warnings.md b/src/content/blog/0015-unique-identifier-no-warnings.md deleted file mode 100644 index 27c98d5..0000000 --- a/src/content/blog/0015-unique-identifier-no-warnings.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -kind: article -created_at: 2012-04-18 -title: Calling UIDevice's -uniqueIdentifier without warnings -slug: uniqueidentifier-no-warnings ---- - -If you use the [TestFlight SDK](https://www.testflightapp.com/sdk/download/) in your iOS app you should be aware of a small but significant change in v1.0 which went live a couple of weeks ago. As [this blog post](http://blog.testflightapp.com/post/19957620625/testflight-sdk-udid-access) explains, the TestFlight SDK no longer includes a device's UDID by default in the data it reports back to the mothership. This means that, again by default, data on sessions, checkpoints etc in the TestFlight SDK console will no longer be associated with a specific tester's device. The reason for the change is that the TestFlight SDK is intended for use on both test and production builds, and Apple will now [reject apps that ask for a device's UDID](http://techcrunch.com/2012/03/24/apple-udids/). - -As a workaround, the TestFlight SDK now contains a new class method, `+setDeviceIdentifier:`, which you can use to add a device's UDID to TestFlight's callback packets in your Ad-Hoc builds by simply adding the following line to your code (I've added it right after my call to `+takeOff:`): - - [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; - -(Note that you'll need to wrap that in an `#ifdef` or similar to ensure that it only gets compiled in to test builds, not production ones.) - -This works fine, but because UIDevice's `-uniqueIdentifier` is now a deprecated method it generates a compiler warning. You'll see something like this in your build logs: - - /Users/simon/dev/personal-projects/apps/zippity/Zippity/ZPAppDelegate.m:70:38: - warning: 'uniqueIdentifier' is deprecated [-Wdeprecated-declarations] - [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; - -Urgh! - -I hate compiler warnings, and eradicate them wherever possible. The reason is simple; if I ignore compiler warnings, I run the risk of missing something meaningful in my build logs. If my build logs perpetually show 20 warnings that I know about and have chosen to ignore, will I notice a new warning when it first appears? Probably not. If I get rid of every compiler warning when it first crops up, my code stays cleaner and new warnings are instantly detected. - -In this case, I can only eradicate the warning by removing the call to `-uniqueIdentifier`, which obviously I don't want to do. So the next best option is to suppress the warning; it's a known issue, so I don't want that warning message cluttering up my build logs for the reasons already mentioned. - -The specific warning I want to suppress is `deprecated-declarations`, as you can see in clang's error output above. (That `[-Wdeprecated-declarations]` indicates that I'm seeing the error because I've got the `deprecated-declarations` warning enabled. As an aside, those notes identifying the warning class that's generating a warning are just one of the reasons I love clang; gcc was never that helpful.) - -I could set Xcode to ignore that error on a per-file basis by setting `-Wno-deprecated-declarations` as a compiler flag for the file in question. (To do that, select your target in Xcode, click on the Build Phases tab, expand the Compile Sources section, then double-click the file you want to add a compiler flag to). But in this case I really want to ignore the warning just for *that one line*. If any other code in this file uses a deprecated declaration, I want to know about it. - -It turns out the way to do it is with clang pragmas. Here's how: - -<script src="https://gist.github.com/2413961.js"> </script> -<noscript><a href="https://gist.github.com/2413961">https://gist.github.com/2413961</a></noscript> - -Job done. \ No newline at end of file diff --git a/src/content/blog/feed-has-moved.md b/src/content/blog/feed-has-moved.md new file mode 100644 index 0000000..cf6cc6c --- /dev/null +++ b/src/content/blog/feed-has-moved.md @@ -0,0 +1,7 @@ +--- +kind: article +created_at: 2012-04-18 +title: This feed has moved! +--- + +This feed has moved - the blog is now located at http://blog.goosoftware.co.uk/ and the feed URL is http://blog.goosoftware.co.uk/atom.xml - see you there! \ No newline at end of file diff --git a/src/lib/navlinks.rb b/src/lib/navlinks.rb index f8c951f..1da2479 100644 --- a/src/lib/navlinks.rb +++ b/src/lib/navlinks.rb @@ -1,9 +1,9 @@ def navlinks return [ { :text => "Home", :url => "/" }, { :text => "Contact", :url => "/contact/" }, { :text => "About", :url => "/about/" }, # { :text => "Help", :url => "/help/" }, - { :text => "Blog", :url => "/blog/" }, + { :text => "Blog", :url => "http://blog.goosoftware.co.uk/" }, ] end \ No newline at end of file
simonwhitaker/goo-website
60f243a832358bc9cbcc18526e3d666a3b82524e
Correct a couple of typos
diff --git a/src/content/blog/0015-unique-identifier-no-warnings.md b/src/content/blog/0015-unique-identifier-no-warnings.md index 1aa43c0..27c98d5 100644 --- a/src/content/blog/0015-unique-identifier-no-warnings.md +++ b/src/content/blog/0015-unique-identifier-no-warnings.md @@ -1,36 +1,37 @@ --- kind: article created_at: 2012-04-18 title: Calling UIDevice's -uniqueIdentifier without warnings slug: uniqueidentifier-no-warnings --- -If you use the [TestFlight SDK](https://www.testflightapp.com/sdk/download/) in your iOS app you should be aware of a small but significant change in v1.0 which went live a couple of weeks ago. As [this blog post](http://blog.testflightapp.com/post/19957620625/testflight-sdk-udid-access) explains, the TestFlight SDK no longer includes a device's UDID by default in the data it reports back to the mothership. This means that, again by default, data on sessions, checkpoints etc in the TestFlight SDK console will no longer be associated to a specific tester's device. The reason for the change is that the TestFlight SDK is intended for use on both test and production builds, and Apple will now [reject apps that ask for a device's UDID](http://techcrunch.com/2012/03/24/apple-udids/). +If you use the [TestFlight SDK](https://www.testflightapp.com/sdk/download/) in your iOS app you should be aware of a small but significant change in v1.0 which went live a couple of weeks ago. As [this blog post](http://blog.testflightapp.com/post/19957620625/testflight-sdk-udid-access) explains, the TestFlight SDK no longer includes a device's UDID by default in the data it reports back to the mothership. This means that, again by default, data on sessions, checkpoints etc in the TestFlight SDK console will no longer be associated with a specific tester's device. The reason for the change is that the TestFlight SDK is intended for use on both test and production builds, and Apple will now [reject apps that ask for a device's UDID](http://techcrunch.com/2012/03/24/apple-udids/). As a workaround, the TestFlight SDK now contains a new class method, `+setDeviceIdentifier:`, which you can use to add a device's UDID to TestFlight's callback packets in your Ad-Hoc builds by simply adding the following line to your code (I've added it right after my call to `+takeOff:`): [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; (Note that you'll need to wrap that in an `#ifdef` or similar to ensure that it only gets compiled in to test builds, not production ones.) This works fine, but because UIDevice's `-uniqueIdentifier` is now a deprecated method it generates a compiler warning. You'll see something like this in your build logs: /Users/simon/dev/personal-projects/apps/zippity/Zippity/ZPAppDelegate.m:70:38: warning: 'uniqueIdentifier' is deprecated [-Wdeprecated-declarations] [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; Urgh! I hate compiler warnings, and eradicate them wherever possible. The reason is simple; if I ignore compiler warnings, I run the risk of missing something meaningful in my build logs. If my build logs perpetually show 20 warnings that I know about and have chosen to ignore, will I notice a new warning when it first appears? Probably not. If I get rid of every compiler warning when it first crops up, my code stays cleaner and new warnings are instantly detected. In this case, I can only eradicate the warning by removing the call to `-uniqueIdentifier`, which obviously I don't want to do. So the next best option is to suppress the warning; it's a known issue, so I don't want that warning message cluttering up my build logs for the reasons already mentioned. The specific warning I want to suppress is `deprecated-declarations`, as you can see in clang's error output above. (That `[-Wdeprecated-declarations]` indicates that I'm seeing the error because I've got the `deprecated-declarations` warning enabled. As an aside, those notes identifying the warning class that's generating a warning are just one of the reasons I love clang; gcc was never that helpful.) I could set Xcode to ignore that error on a per-file basis by setting `-Wno-deprecated-declarations` as a compiler flag for the file in question. (To do that, select your target in Xcode, click on the Build Phases tab, expand the Compile Sources section, then double-click the file you want to add a compiler flag to). But in this case I really want to ignore the warning just for *that one line*. If any other code in this file uses a deprecated declaration, I want to know about it. It turns out the way to do it is with clang pragmas. Here's how: <script src="https://gist.github.com/2413961.js"> </script> +<noscript><a href="https://gist.github.com/2413961">https://gist.github.com/2413961</a></noscript> Job done. \ No newline at end of file
simonwhitaker/goo-website
1c6c44631bb74ea3dc3cd62b870132afbef9b325
New blog post: calling UIDevice's -uniqueIdentifier without warnings
diff --git a/src/content/blog/0015-unique-identifier-no-warnings.md b/src/content/blog/0015-unique-identifier-no-warnings.md new file mode 100644 index 0000000..1aa43c0 --- /dev/null +++ b/src/content/blog/0015-unique-identifier-no-warnings.md @@ -0,0 +1,36 @@ +--- +kind: article +created_at: 2012-04-18 +title: Calling UIDevice's -uniqueIdentifier without warnings +slug: uniqueidentifier-no-warnings +--- + +If you use the [TestFlight SDK](https://www.testflightapp.com/sdk/download/) in your iOS app you should be aware of a small but significant change in v1.0 which went live a couple of weeks ago. As [this blog post](http://blog.testflightapp.com/post/19957620625/testflight-sdk-udid-access) explains, the TestFlight SDK no longer includes a device's UDID by default in the data it reports back to the mothership. This means that, again by default, data on sessions, checkpoints etc in the TestFlight SDK console will no longer be associated to a specific tester's device. The reason for the change is that the TestFlight SDK is intended for use on both test and production builds, and Apple will now [reject apps that ask for a device's UDID](http://techcrunch.com/2012/03/24/apple-udids/). + +As a workaround, the TestFlight SDK now contains a new class method, `+setDeviceIdentifier:`, which you can use to add a device's UDID to TestFlight's callback packets in your Ad-Hoc builds by simply adding the following line to your code (I've added it right after my call to `+takeOff:`): + + [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; + +(Note that you'll need to wrap that in an `#ifdef` or similar to ensure that it only gets compiled in to test builds, not production ones.) + +This works fine, but because UIDevice's `-uniqueIdentifier` is now a deprecated method it generates a compiler warning. You'll see something like this in your build logs: + + /Users/simon/dev/personal-projects/apps/zippity/Zippity/ZPAppDelegate.m:70:38: + warning: 'uniqueIdentifier' is deprecated [-Wdeprecated-declarations] + [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; + +Urgh! + +I hate compiler warnings, and eradicate them wherever possible. The reason is simple; if I ignore compiler warnings, I run the risk of missing something meaningful in my build logs. If my build logs perpetually show 20 warnings that I know about and have chosen to ignore, will I notice a new warning when it first appears? Probably not. If I get rid of every compiler warning when it first crops up, my code stays cleaner and new warnings are instantly detected. + +In this case, I can only eradicate the warning by removing the call to `-uniqueIdentifier`, which obviously I don't want to do. So the next best option is to suppress the warning; it's a known issue, so I don't want that warning message cluttering up my build logs for the reasons already mentioned. + +The specific warning I want to suppress is `deprecated-declarations`, as you can see in clang's error output above. (That `[-Wdeprecated-declarations]` indicates that I'm seeing the error because I've got the `deprecated-declarations` warning enabled. As an aside, those notes identifying the warning class that's generating a warning are just one of the reasons I love clang; gcc was never that helpful.) + +I could set Xcode to ignore that error on a per-file basis by setting `-Wno-deprecated-declarations` as a compiler flag for the file in question. (To do that, select your target in Xcode, click on the Build Phases tab, expand the Compile Sources section, then double-click the file you want to add a compiler flag to). But in this case I really want to ignore the warning just for *that one line*. If any other code in this file uses a deprecated declaration, I want to know about it. + +It turns out the way to do it is with clang pragmas. Here's how: + +<script src="https://gist.github.com/2413961.js"> </script> + +Job done. \ No newline at end of file
simonwhitaker/goo-website
75ca4ecd16a69815936b6c0a5deed12b5d10b9a5
Add blog post on developing Zippity
diff --git a/src/content/blog/0014-developing-zippity.md b/src/content/blog/0014-developing-zippity.md new file mode 100644 index 0000000..57f564a --- /dev/null +++ b/src/content/blog/0014-developing-zippity.md @@ -0,0 +1,42 @@ +--- +kind: article +created_at: 2012-04-10 +title: On Zippity – notes from a small iPhone app +slug: on-zippity +--- + +[Zippity](http://www.zippityapp.co.uk/) hit the App store last week. It's a simple utility app for opening zip files, and I'm very proud of it. That's no mistake; from day one I worked hard to *make sure* Zippity would be an app I was proud of. Here are a few of the decisions I made along the way. + +## Zippity uses standard UI elements + +To some, standard UI elements might seem like the lazy option, but for me there's always a strong urge to be creative and create some fun little widgets to make an app stand out. It's a truth universally acknowledged that every iOS developer secretly wants to work for [Tapbots](http://www.tapbots.com). :-) + +For a utility app like Zippity though, I didn't feel there was any room for unorthodox UI elements. This isn't an app that people will live in day in, day out. It's an app that most people will only use occasionally, and for those users it's going to be a pain if every time they open the app they have to re-learn how to use it. So, my first rule was: no custom UI elements where there's a UIKit alternative. + +On a similar note, I also didn't want functionality that could only be accessed by gestures. Gestures offer developers a nice way to add "power user" features, but Zippity is built from the ground up to make all of its functionality obvious to casual users. + +## Zippity doesn't want to be your friend + +Zippity won't ask you to like it on Facebook, rate it on the App Store or recommend it to your friends. I don't like apps that nag me for my approval (even though I understand why they do it), so Zippity doesn't do that. This might mean I die a penniless failure while other app developers enjoy the rich rewards of tapping into the social graph, but I'm fine with that. At least I'll never be remembered as the guy who wrote that needy zip file app. + +## Zippity makes sensible choices about what to show you and how to show it + +By default, Zippity doesn't show file extensions (although you can change that if you really want to). Instead, the icon next to a file generally shows what sort of file it is. (For visually impaired users however, Zippity does speak the file extension, since those icons are only useful clues for sighted users.) + +When showing you the contents of a zip file with multiple nested, otherwise-empty folders, Zippity collapses those folders down. For example, if the physical structure of the unzipped contents looks like this: + +![Illustration of Zippity's physical folder structure](/images/blog/zippity-folder-structure-physical.png) + +Zippity will present a logical view that looks like this: + +![Illustration of Zippity's logical folder structure](/images/blog/zippity-folder-structure-logical.png) + +## Zippity talks your language + +I've tried to avoid technical language wherever possible in Zippity's interface and associated user-facing content. For example in its App Store description, on the Zippity website and anywhere else you see blurb about Zippity it talks about being an app for opening "zip files". In fact Zippity handles a number of other archive formats, more geeky stuff like .tar, .gz and .bzip2, but I use the term "zip files" to cover all these archive formats. While that's technically incorrect, it's the terminology that makes sense to most people. + +Zippity talks your language in another way too; if you're a Dutch or Hungarian speaker then Zippity 1.0.1 (currently awaiting App Store approval) has an interface completely translated into your mother tongue. Other translations are coming soon! (If you're interested in helping to translate Zippity into your language please [get in touch](http://twitter.com/s1mn).) + +## Zippity looks nice + +Even utility apps can look nice, and Zippity's no exception. It has a great icon (and another great, bespoke document icon) created by my friend and iconic iconographer, [Jon Hicks](http://twitter.com/hicksdesign). A different navigation bar colour and a subtle background from [subtlepatterns.com](http://subtlepatterns.com) in the "About Zippity" view give it a distinct visual identity and help to ensure that it can't be mistaken at a glance for Zippity's main view (i.e. the contents of a zip file). \ No newline at end of file diff --git a/src/content/images/blog/zippity-folder-structure-logical.png b/src/content/images/blog/zippity-folder-structure-logical.png new file mode 100644 index 0000000..372b5f5 Binary files /dev/null and b/src/content/images/blog/zippity-folder-structure-logical.png differ diff --git a/src/content/images/blog/zippity-folder-structure-physical.png b/src/content/images/blog/zippity-folder-structure-physical.png new file mode 100644 index 0000000..66e408f Binary files /dev/null and b/src/content/images/blog/zippity-folder-structure-physical.png differ
simonwhitaker/goo-website
8a8e093b71c2bc3ea1037c7a58687661f410808a
Add Zippity to the home page
diff --git a/src/content/images/apps/zippity.png b/src/content/images/apps/zippity.png new file mode 100644 index 0000000..d422cb9 Binary files /dev/null and b/src/content/images/apps/zippity.png differ diff --git a/src/content/index.yaml b/src/content/index.yaml index 02b764a..7b5282f 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,92 +1,101 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: + - name: "Zippity" + slug: zippity + slogan: Put your zip in it + itunes_url: http://itunes.apple.com/gb/app/zippity/id513855390?ls=1&mt=8 + image: /images/apps/zippity.png + description: + - > The easiest way to handle zip files on your iPhone! + View contents, send individual files by email, add + images to your Camera Roll, and more. + - > Handles .zip, .tar, .gz, .tar.gz. + - > See <a href="http://www.zippityapp.co.uk">www.zippityapp.co.uk</a> + client: Goo Software! This is one of our own. + platform: iPhone and iPod Touch + - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford - slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png accolades: - > Named by Apple as one of the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best apps of 2011</a> in the UK App Store description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware - slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png accolades: - > Winner, Charity and Voluntary Sector<br><a href="http://www.nmaawards.co.uk/winners2011.aspx">NMA Awards 2011</a> description: - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! - slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience - slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go - slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
d134f0649c4dc73b6d5a548b86bc2b840a811c1b
Added blog post on iOS photo hierarchy
diff --git a/src/content/blog/0013-ios-photo-hierarchy.md b/src/content/blog/0013-ios-photo-hierarchy.md new file mode 100644 index 0000000..fa05734 --- /dev/null +++ b/src/content/blog/0013-ios-photo-hierarchy.md @@ -0,0 +1,13 @@ +--- +kind: article +created_at: 2012-03-01 +title: The hierarchy in iOS 5's photo library +slug: ios-photo-hierarchy +--- + +I finally had a need to get my head around the complex hierarchy of photos in iOS's Photos app, and how they mapped to the flatter hierarchy in the iOS photo picker control. Here are the fruits of my labour - hope you find them helpful. (Click the image for a large version.) + +[![Photo organisation in iOS 5.0][img-thumb]][img-large] + +[img-thumb]: http://f.cl.ly/items/1t2F1O0L0c05001J0Y24/ios-photo-hierarchy-thumb.png +[img-large]: http://f.cl.ly/items/1P2L2a240Z0G3i400H06/ios-photo-hierarchy.png \ No newline at end of file
simonwhitaker/goo-website
0ee176545e183692a69f19ed191177e8a2479b70
Add link to Super User post on setting up hidden user accounts in OS X
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index a2712f5..cdcb5f0 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,125 +1,125 @@ --- kind: article created_at: 2012-02-07 title: Running a simple Git server using SSH slug: how-to-run-your-own-simple-git-server --- I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be both easy and useful, so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git and away I go. So, the question was: how do I create a remote on my own device and access it in the same way? ## Unpicking the SSH notation It's helpful to first understand what the SSH notation actually means. It's really simple. The basic format is: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. So, here's what I had to do to set up a git server on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges; a plain old user account will do fine. For the sake of simplicity, on the server (running OS X, remember) I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. -(That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) +(That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you're using OS X and you want to create a user who doesn't appear in the login screen, see [this Super User answer](http://superuser.com/a/268441/62672) for details.) ## Step 2: Set up passwordless SSH On my laptop I opened a terminal window and checked to see if I had a current public SSH key: $ ls ~/.ssh/id_rsa.pub I did. (If you don't have one, you can create a new public/private key pair by running `ssh-keygen` and following the prompts.) Next I copied my public key to the git user's home directory on the server, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys That's it, passwordless-SSH is now set up. If you're following along at home you can try it for yourself: log out of the server then log back in: $ ssh git@[your server name] You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories Logging in to the server once again as git, I created a directory called simon in git's home directory. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. This one was pretty simple, too. First I created a directory to hold the repository. I followed Github's convention and named the directory as [project name].git: $ ssh git@Goo-mini.local $ mkdir simon/myproject.git Finally, I initialised a bare Git repository in that directory: $ cd simon/myproject.git $ git init --bare Note the `--bare` option to `git init`: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out All that was left was to push my repository to my new git server. On my laptop I ran the following: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is... you guessed it... [on Github](https://github.com/simonwhitaker/goo-website/blob/master/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file
simonwhitaker/goo-website
e4acbef77b95cfa27900c29a7508efa6ded7638f
Added noscript tag for embedded gist
diff --git a/src/content/blog/0010-save-to-dated-folder.md b/src/content/blog/0010-save-to-dated-folder.md index c5369ca..5e10510 100644 --- a/src/content/blog/0010-save-to-dated-folder.md +++ b/src/content/blog/0010-save-to-dated-folder.md @@ -1,16 +1,17 @@ --- kind: article created_at: 2012-02-02 title: Dated PDF Saver --- Here's a nifty script I use to save emailed receipts as PDFs in a folder hierarchy that includes the date (year and month) on which they were saved. It helps keep my business receipts organised and saves me a bit of time when I'm looking for receipts after the event. Hopefully you might find it useful too. It's on Github so feel free to clone, tweak and share. (Don't ask about the license. It's a 2-line shell script with 65 lines of comments and context. It's free, in every possible sense of the word.) -<script src="https://gist.github.com/1722378.js"> </script> \ No newline at end of file +<script src="https://gist.github.com/1722378.js"> </script> +<noscript><a href="https://gist.github.com/1722378">https://gist.github.com/1722378</a></noscript> \ No newline at end of file
simonwhitaker/goo-website
6be5d4fcb13819d08cb6b8d3ee3e3786dce44813
Added blog article on adding setting an app's CFBundleVersion using git describe
diff --git a/src/content/blog.rhtml b/src/content/blog.rhtml index ab9c212..7e34cd6 100644 --- a/src/content/blog.rhtml +++ b/src/content/blog.rhtml @@ -1,14 +1,12 @@ --- -title: Latest blog articles +title: The Goo Software Geek Blog --- -<!-- <h1>Latest blog articles</h1> --> - <ul class="blog-items"> <% for article in sorted_articles %> <li> <a href="<%= article.path %>"><%= article[:title] %></a> <span class="date">(<%= article[:created_at]%>)</span> </li> <% end %> </ul> diff --git a/src/content/blog/0012-xcode-git-revision.md b/src/content/blog/0012-xcode-git-revision.md new file mode 100644 index 0000000..b92cefc --- /dev/null +++ b/src/content/blog/0012-xcode-git-revision.md @@ -0,0 +1,34 @@ +--- +kind: article +created_at: 2012-02-08 +title: Append Git revision to an app’s bundle version at build time +slug: xcode-git-revision +--- + +A while ago I blogged a [dirty hack](/blog/append-subversion-revision-to-an-iphone-apps-bundle-version-at-build-time/) +to append the current Subversion revision to the version number of an iPhone app +automatically at build time. Well, I haven't used Subversion for a while now, +having experienced a Damascene conversion to Git last year. + +So, here's the same hack, but updated for Git. This time it's even more hacky because, +unlike Subversion, Git doesn't assign linear revision numbers every time you check code +in. If you think of a typical Git branching graph that makes sense. So this hack +uses `git describe` and then carves up the output to create its pseudo-version number. +It's dirty, but it does the trick. + +To use: + +1. In Xcode 4, click on your project file (the one with the blue icon) in the Project Navigator +2. Click Build Phases +3. Click the Add Build Phase at the bottom of the screen and choose Add Run Script +4. Leave the shell set as /bin/sh. Copy the code below and paste it into the script panel +5. Build your app + +Here's the code: + +<script src="https://gist.github.com/1770898.js?file=git-version.sh"></script> +<noscript><a href="https://gist.github.com/1770898">https://gist.github.com/1770898</a></noscript> + +This is a bit of a dirty one, but it works for me. If you have suggested improvements I'm all ears so please +leave a comment. + diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index 184561c..98b440b 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,97 +1,101 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <script type="text/javascript" src="http://use.typekit.com/osv2fuk.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta name="viewport" content="width=device-width"> <meta name = "format-detection" content = "telephone=no"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Thoughts on developing fantastic apps for iPhone, iPad and iPod Touch </div> </div> <!-- Sidebar --> <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> <% end %> <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> <% end %> <div class="blog-content"> <%= yield %> </div> <div class="twitter"> <p>To comment on this post, drop me a line <a href="http://twitter.com/s1mn/">on Twitter</a>.</p> </div> <!-- Previous / next nav --> <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> + + <% if @item != sorted_articles.first && @item != sorted_articles.last then %> + <span class="nav"> ... </span> + <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> </div> <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
5ea513df3172bfbcb6d036496fbecfbda40c8c25
Add support for specific slugs in blog posts, revert slug of re-titled Git server post
diff --git a/src/Rules b/src/Rules index ba43c40..1282343 100644 --- a/src/Rules +++ b/src/Rules @@ -1,66 +1,67 @@ #!/usr/bin/env ruby # A few helpful tips about the Rules file: # # * The order of rules is important: for each item, only the first matching # rule is applied. # # * Item identifiers start and end with a slash (e.g. “/about/” for the file # “content/about.html”). To select all children, grandchildren, … of an # item, use the pattern “/about/*/”; “/about/*” will also select the parent, # because “*” matches zero or more characters. compile '/blog/feed/' do filter :erb end compile '/blog/' do filter :erb layout 'blog' end compile '*' do do_layout = false if item[:extension] =~ /(md|markdown)/ filter :kramdown do_layout = true elsif item[:extension] =~ /r?html/ filter :erb do_layout = true end if do_layout then if item[:kind] == 'article' or item[:kind] == 'draft' layout 'blog' else layout 'goo' end end end route '/blog/feed/' do '/blog.xml' end route %r{^/(css|js|images)/.*/} do item.identifier.chop + '.' + item[:extension] end route '/error/*/' do item.identifier.chop + '.html' end route '/htaccess/' do '/.htaccess' end route '/blog/*/' do - '/blog/' + item[:title].to_slug + '/index.html' + slug = item[:slug] || item[:title].to_slug + '/blog/' + slug + '/index.html' end route '*' do item.identifier + 'index.html' end layout '*', :erb diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index 035e7bc..a2712f5 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,124 +1,125 @@ --- kind: article created_at: 2012-02-07 title: Running a simple Git server using SSH +slug: how-to-run-your-own-simple-git-server --- I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be both easy and useful, so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git and away I go. So, the question was: how do I create a remote on my own device and access it in the same way? ## Unpicking the SSH notation It's helpful to first understand what the SSH notation actually means. It's really simple. The basic format is: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. So, here's what I had to do to set up a git server on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges; a plain old user account will do fine. For the sake of simplicity, on the server (running OS X, remember) I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) ## Step 2: Set up passwordless SSH On my laptop I opened a terminal window and checked to see if I had a current public SSH key: $ ls ~/.ssh/id_rsa.pub I did. (If you don't have one, you can create a new public/private key pair by running `ssh-keygen` and following the prompts.) Next I copied my public key to the git user's home directory on the server, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys That's it, passwordless-SSH is now set up. If you're following along at home you can try it for yourself: log out of the server then log back in: $ ssh git@[your server name] You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories Logging in to the server once again as git, I created a directory called simon in git's home directory. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. This one was pretty simple, too. First I created a directory to hold the repository. I followed Github's convention and named the directory as [project name].git: $ ssh git@Goo-mini.local $ mkdir simon/myproject.git Finally, I initialised a bare Git repository in that directory: $ cd simon/myproject.git $ git init --bare Note the `--bare` option to `git init`: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out All that was left was to push my repository to my new git server. On my laptop I ran the following: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is... you guessed it... [on Github](https://github.com/simonwhitaker/goo-website/blob/master/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file
simonwhitaker/goo-website
4c69592686137f747efd98a3a84b8815e15be849
Minor text changes
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index b8cfc30..c4be3b7 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,124 +1,124 @@ --- kind: article created_at: 2012-02-07 title: How to run your own simple Git server --- I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be both easy and handy so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git and away I go. So, the question was: how do I create a remote on my own device and access it in the same way? ## Unpicking the SSH notation -It's helpful to first understand what that notation Github uses actually means. It's really simple. The basic format is: +It's helpful to first understand what the SSH notation actually means. It's really simple. The basic format is: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. So, here's what I had to do to set up a git server on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges; a plain old user account will do fine. For the sake of simplicity, on the server (running OS X, remember) I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) ## Step 2: Set up passwordless SSH On my laptop I opened a terminal window and checked to see if I had a current public SSH key: $ ls ~/.ssh/id_rsa.pub I did. (If you don't have one, you can create a new public/private key pair by running `ssh-keygen` and following the prompts.) Next I copied my public key to the git user's home directory on the server, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys That's it, passwordless-SSH is now set up. If you're following along at home you can try it for yourself: log out of the server then log back in: $ ssh git@[your server name] You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories Logging in to the server once again as git, I created a directory called simon in git's home directory. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. This one was pretty simple, too. First I created a directory to hold the repository. I followed Github's convention and named the directory as [project name].git: $ ssh git@Goo-mini.local $ mkdir simon/myproject.git Finally, I initialised a bare Git repository in that directory: $ cd simon/myproject.git $ git init --bare Note the `--bare` option to `git init`: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out All that was left was to push my repository to my new git server. On my laptop I ran the following: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is... you guessed it... [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file
simonwhitaker/goo-website
e9fc0e8910e6f70ab922ae3883a42d776356ddb3
Text differences
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index 118dbcf..b8cfc30 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,126 +1,124 @@ --- kind: article created_at: 2012-02-07 title: How to run your own simple Git server --- -I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be pretty handy so I thought I'd document how I did it. +I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be both easy and handy so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git -and away I go. So, the question was, how do I create a remote on my own device and access it in the same way. +and away I go. So, the question was: how do I create a remote on my own device and access it in the same way? ## Unpicking the SSH notation -It helps to first understand what the notation Github uses actually means. It's really simple. The basic format is: +It's helpful to first understand what that notation Github uses actually means. It's really simple. The basic format is: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. -Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I then connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. +Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. -So, here's what I had to do on my Mac mini: +So, here's what I had to do to set up a git server on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user -The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges, a plain old user account will do fine. +The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges; a plain old user account will do fine. -For the sake of simplicity, on the server I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. +For the sake of simplicity, on the server (running OS X, remember) I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) ## Step 2: Set up passwordless SSH -On my laptop I opened a terminal window and checked to see if I have a current public SSH key: +On my laptop I opened a terminal window and checked to see if I had a current public SSH key: $ ls ~/.ssh/id_rsa.pub -I did. If you don't have one, you can create a new public/private key pair using ssh-keygen: +I did. (If you don't have one, you can create a new public/private key pair by running `ssh-keygen` and following the prompts.) - $ ssh-keygen - -Once that's done, I needed to copy my public key to the server. I copied it to the git user's home directory, like this: +Next I copied my public key to the git user's home directory on the server, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys -That's it, passwordless-SSH is now set up. Try it out: log out of the server then log back in: +That's it, passwordless-SSH is now set up. If you're following along at home you can try it for yourself: log out of the server then log back in: $ ssh git@[your server name] -You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. +You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories -I'm going to log in as git and create a directory called simon in git's home directory. This will store my repositories on the server. +Logging in to the server once again as git, I created a directory called simon in git's home directory. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. -This one's pretty simple, too. First I create a directory to hold the repository. I'll follow Github's convention and name the directory as [project name].git: +This one was pretty simple, too. First I created a directory to hold the repository. I followed Github's convention and named the directory as [project name].git: $ ssh git@Goo-mini.local - $ mkdir -p simon/myproject.git - $ cd simon/myproject.git + $ mkdir simon/myproject.git -Now I need to initialise a bare Git repository in that directory: +Finally, I initialised a bare Git repository in that directory: + $ cd simon/myproject.git $ git init --bare -Note the `--bare` option: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. +Note the `--bare` option to `git init`: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out -That's it, we're done! Let's try it out. On my own laptop: +All that was left was to push my repository to my new git server. On my laptop I ran the following: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. -If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is… you guessed it… [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file +If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is... you guessed it... [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file
simonwhitaker/goo-website
9ac25eecd1b5ccafea70853e3f1d71b661a150a3
Minor text changes
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index aee125b..118dbcf 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,126 +1,126 @@ --- kind: article created_at: 2012-02-07 title: How to run your own simple Git server --- I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be pretty handy so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git and away I go. So, the question was, how do I create a remote on my own device and access it in the same way. ## Unpicking the SSH notation -It helps to first have an understanding of exactly what that notation Github uses actually means. It's really simple. The notation adheres to the following pattern: +It helps to first understand what the notation Github uses actually means. It's really simple. The basic format is: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I then connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. So, here's what I had to do on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges, a plain old user account will do fine. For the sake of simplicity, on the server I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) ## Step 2: Set up passwordless SSH On my laptop I opened a terminal window and checked to see if I have a current public SSH key: $ ls ~/.ssh/id_rsa.pub I did. If you don't have one, you can create a new public/private key pair using ssh-keygen: $ ssh-keygen Once that's done, I needed to copy my public key to the server. I copied it to the git user's home directory, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys That's it, passwordless-SSH is now set up. Try it out: log out of the server then log back in: $ ssh git@[your server name] You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories I'm going to log in as git and create a directory called simon in git's home directory. This will store my repositories on the server. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. This one's pretty simple, too. First I create a directory to hold the repository. I'll follow Github's convention and name the directory as [project name].git: $ ssh git@Goo-mini.local $ mkdir -p simon/myproject.git $ cd simon/myproject.git Now I need to initialise a bare Git repository in that directory: $ git init --bare Note the `--bare` option: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out That's it, we're done! Let's try it out. On my own laptop: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. -If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is… you guessed it… [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a push request. \ No newline at end of file +If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is… you guessed it… [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a pull request. \ No newline at end of file
simonwhitaker/goo-website
3ce62d61758af8dd60ebcf68ccec40e96b1bfcb8
Fixing line height in blog headings
diff --git a/src/content/css/blog.css b/src/content/css/blog.css index 33885f7..af5f230 100644 --- a/src/content/css/blog.css +++ b/src/content/css/blog.css @@ -1,226 +1,230 @@ @import url('base.css'); body { background-color: #eee; max-width: 1200px; } #header { border-bottom: 1px solid #444; } #content { /* background-color: #000;*/ margin-right: 220px; color: #333; } #slogan { color: #666; } /* Code ----------------------------------------*/ pre, code { font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 14px; /* color: #eee;*/ } pre, blockquote { margin: 0; padding: 12px; background-color: #ddd; border-radius: 5px; } /* Blog article navigation */ .blog-nav { margin: 12px 0; font-size: 13px; } .blog-nav .nav { padding: 0; margin: 0; } /* Misc blog formatting */ h1 { color: #09f; font-size: 33px; line-height: 1.1em; } h2 { color: #333; font-size: 28px; font-weight: normal; } h3 { color: #333; font-size: 20px; font-weight: normal; } +h1, h2, h3 { + line-height: 1.2em; +} + .meta { /* color: #666;*/ font-style: italic; } .twitter { font-style: italic; color: #666; } blockquote { padding: 20px 20px 20px 70px; background-image: url(../images/open-quote.png); background-repeat: no-repeat; } a[href] { color: #08d; } /* Comments */ .comments { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #777; } /* Latest posts */ #sidebar { float: right; width: 200px; padding: 20px 10px; margin: 0; font-size: 13px; } #sidebar a { color: #666; } #sidebar a:hover { color: #09f; } #sidebar .subscribe a { background-image: url("/images/feed-icon-14x14.png"); background-position: right 0; background-repeat: no-repeat; padding-right: 17px; } #sidebar h2 { color: #444; font-size: 20px; text-transform: uppercase; padding: 0; } #sidebar ul { margin: 0; padding: 0; } #sidebar li { display: block; padding: 0; } #sidebar li a { display: block; padding: 5px 0; } #sidebar li a.selected { font-weight: bold; } img.framed { border-color: #666; } #footer { clear: both; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-image: none; } code { display: block; max-width: 480px; overflow: hidden; } img { max-width: 400px; margin: 6px 0; padding: 0; } img.framed { border-width: 0; padding: 0; margin: 6px 0; } #sidebar { display: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; border-width: 0; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 10px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } } \ No newline at end of file
simonwhitaker/goo-website
3c6d0b8e45108a90f240c4648ca2bb6e89a29ba9
Wording changes in blog article
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md index 0738401..aee125b 100644 --- a/src/content/blog/0011-quick-git-server.md +++ b/src/content/blog/0011-quick-git-server.md @@ -1,121 +1,126 @@ --- kind: article created_at: 2012-02-07 title: How to run your own simple Git server --- I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be pretty handy so I thought I'd document how I did it. Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. ## What I wanted I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: git@github.com:simonwhitaker/PyAPNs.git Then I'll clone that remote by running: git clone git@github.com:simonwhitaker/PyAPNs.git and away I go. So, the question was, how do I create a remote on my own device and access it in the same way. ## Unpicking the SSH notation It helps to first have an understanding of exactly what that notation Github uses actually means. It's really simple. The notation adheres to the following pattern: [username]@[hostname]:[path to repository] That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I then connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. So, here's what I had to do on my Mac mini: 1. Create a new user called git 2. Set up passwordless SSH so that I can connect to my git user's account without a password 3. Create a directory in git's home directory for storing my repositories 4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. ## Step 1: Create the git user -The steps on how to do this will vary depending on your operating system. For the sake of simplicity, on the server I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) +The steps on how to do this will vary depending on your operating system. The git user doesn't need (indeed, shouldn't have) administrator or sudo privileges, a plain old user account will do fine. + +For the sake of simplicity, on the server I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. + +(That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) ## Step 2: Set up passwordless SSH On my laptop I opened a terminal window and checked to see if I have a current public SSH key: $ ls ~/.ssh/id_rsa.pub I did. If you don't have one, you can create a new public/private key pair using ssh-keygen: $ ssh-keygen Once that's done, I needed to copy my public key to the server. I copied it to the git user's home directory, like this: $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: $ ssh git@Goo-mini.local Again, I entered the git user's password when prompted. Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. $ mkdir -p .ssh $ cat id_rsa.pub >> .ssh/authorized_keys Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. $ chmod 700 .ssh $ chmod 400 .ssh/authorized_keys That's it, passwordless-SSH is now set up. Try it out: log out of the server then log back in: $ ssh git@[your server name] You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. ## Step 3: Create a directory in git's home directory for storing my repositories I'm going to log in as git and create a directory called simon in git's home directory. This will store my repositories on the server. $ ssh git@Goo-mini.local $ mkdir simon Simple. ## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. This one's pretty simple, too. First I create a directory to hold the repository. I'll follow Github's convention and name the directory as [project name].git: $ ssh git@Goo-mini.local $ mkdir -p simon/myproject.git $ cd simon/myproject.git Now I need to initialise a bare Git repository in that directory: $ git init --bare Note the `--bare` option: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. ## Trying it out That's it, we're done! Let's try it out. On my own laptop: $ cd /path/to/git/repo $ git remote add origin git@Goo-mini.local:simon/myproject.git $ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 232 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@Goo-mini.local:simon/myproject.git * [new branch] master -> master Cooooool! ## Next steps There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. +If you find ways to improve the process, please do [let me know](http://twitter.com/s1mn/). Alternatively, the source for this page is… you guessed it… [on Github](https://github.com/simonwhitaker/goo-website/blob/develop/src/content/blog/0011-quick-git-server.md)! Feel free to clone it, tweak it and send me a push request. \ No newline at end of file
simonwhitaker/goo-website
7cabd82668e9d3f5d8797c1d40b4c197d1ebc6b4
New blog article
diff --git a/src/content/blog/0011-quick-git-server.md b/src/content/blog/0011-quick-git-server.md new file mode 100644 index 0000000..0738401 --- /dev/null +++ b/src/content/blog/0011-quick-git-server.md @@ -0,0 +1,121 @@ +--- +kind: article +created_at: 2012-02-07 +title: How to run your own simple Git server +--- + +I had the need recently to set up a temporary git remote on a Mac mini on my local network. It turned out to be pretty handy so I thought I'd document how I did it. + +Throughout this article I'll refer to the Mac mini where I set up the remote repository as **the server**, and my Macbook Pro (my primary work computer) as **my laptop**. + +## What I wanted + +I use Github a lot, so I'm used to representing my remotes in the SSH style, like this: + + git@github.com:simonwhitaker/PyAPNs.git + +Then I'll clone that remote by running: + + git clone git@github.com:simonwhitaker/PyAPNs.git + +and away I go. So, the question was, how do I create a remote on my own device and access it in the same way. + +## Unpicking the SSH notation + +It helps to first have an understanding of exactly what that notation Github uses actually means. It's really simple. The notation adheres to the following pattern: + + [username]@[hostname]:[path to repository] + +That's it. So that Github connect string from earlier means that I'm connecting to the server at **github.com** as the **git** user, and cloning the repository that exists at **simonwhitaker/PyAPNs.git** within the git user's home directory. + +Hang on though - I don't have a password for the git user on github.com, so how come I can read and write stuff in their home directory? It's because I've set up **passwordless SSH** by uploading my SSH public key to Github. When I then connect via SSH, the SSH server at github.com looks to see if the private SSH key on my computer matches a public key on github.com. If it does, I'm allowed in. + +So, here's what I had to do on my Mac mini: + +1. Create a new user called git +2. Set up passwordless SSH so that I can connect to my git user's account without a password +3. Create a directory in git's home directory for storing my repositories +4. For each repository I want to host: log in to git's account on my Mac mini and initialise a new Git repository. + +## Step 1: Create the git user + +The steps on how to do this will vary depending on your operating system. For the sake of simplicity, on the server I just opened System Preferences > Accounts and added a new user, setting their username to git and giving them a suitably strong password. (That's not a perfect solution: it sets git up as a regular user so e.g. they appear in the login screen, but it works fine for me. If you want to create a user who doesn't appear in the login screen you can search online for how to do that.) + +## Step 2: Set up passwordless SSH + +On my laptop I opened a terminal window and checked to see if I have a current public SSH key: + + $ ls ~/.ssh/id_rsa.pub + +I did. If you don't have one, you can create a new public/private key pair using ssh-keygen: + + $ ssh-keygen + +Once that's done, I needed to copy my public key to the server. I copied it to the git user's home directory, like this: + + $ scp ~/.ssh/id_rsa.pub git@Goo-mini.local: + +When prompted, I entered **git's password** (the one I set up earlier). Then I connected to the server over SSH, again using the git account: + + $ ssh git@Goo-mini.local + +Again, I entered the git user's password when prompted. + +Once logged in as git, I copied my public SSH key into the list of authorised keys for that user. + + $ mkdir -p .ssh + $ cat id_rsa.pub >> .ssh/authorized_keys + +Then I locked down the permissions on .ssh and its contents, since the SSH server is fussy about this. + + $ chmod 700 .ssh + $ chmod 400 .ssh/authorized_keys + +That's it, passwordless-SSH is now set up. Try it out: log out of the server then log back in: + + $ ssh git@[your server name] + +You should be logged straight in without being prompted for a password. If you're not, something's gone wrong - check through the instructions so far and make sure you didn't miss something. + +## Step 3: Create a directory in git's home directory for storing my repositories + +I'm going to log in as git and create a directory called simon in git's home directory. This will store my repositories on the server. + + $ ssh git@Goo-mini.local + $ mkdir simon + +Simple. + +## Step 4: For each repository I want to host, log in to git's account on my Mac mini and initialise a new Git repository. + +This one's pretty simple, too. First I create a directory to hold the repository. I'll follow Github's convention and name the directory as [project name].git: + + $ ssh git@Goo-mini.local + $ mkdir -p simon/myproject.git + $ cd simon/myproject.git + +Now I need to initialise a bare Git repository in that directory: + + $ git init --bare + +Note the `--bare` option: that means that rather than creating all Git's config in a .git subdirectory it'll be created directly in myproject.git, which is what we want. + +## Trying it out + +That's it, we're done! Let's try it out. On my own laptop: + + $ cd /path/to/git/repo + $ git remote add origin git@Goo-mini.local:simon/myproject.git + $ git push origin master + Counting objects: 3, done. + Writing objects: 100% (3/3), 232 bytes, done. + Total 3 (delta 0), reused 0 (delta 0) + To git@Goo-mini.local:simon/myproject.git + * [new branch] master -> master + +Cooooool! + +## Next steps + +There are loads of ways you could improve this process. For example, any user who uploads their public SSH key would have access to all repositories in git's home directory. You might want to change that, for example so that users can only write to their own repositories. +
simonwhitaker/goo-website
9cc12e807359867a19335941e0da985c32bff2cd
New blog post
diff --git a/src/content/blog/0010-save-to-dated-folder.md b/src/content/blog/0010-save-to-dated-folder.md new file mode 100644 index 0000000..c5369ca --- /dev/null +++ b/src/content/blog/0010-save-to-dated-folder.md @@ -0,0 +1,16 @@ +--- +kind: article +created_at: 2012-02-02 +title: Dated PDF Saver +--- + +Here's a nifty script I use to save emailed receipts as PDFs in a folder +hierarchy that includes the date (year and month) on which they were saved. +It helps keep my business receipts organised and saves me a bit of time +when I'm looking for receipts after the event. Hopefully you might find it +useful too. It's on Github so feel free to clone, tweak and share. + +(Don't ask about the license. It's a 2-line shell script with 65 lines +of comments and context. It's free, in every possible sense of the word.) + +<script src="https://gist.github.com/1722378.js"> </script> \ No newline at end of file
simonwhitaker/goo-website
a76d17a88cb230e4307d3ffae3a913bd0f569121
Nicer Android store links
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 20656b7..ddce5d4 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,284 +1,277 @@ @import url('base.css'); body { max-width: 980px; } #main { padding: 0; margin: 0 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 24px; left: 130px; top: 140px; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 15px 5px 20px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } #nav .tabs li a:hover { background-color: #3C4200; } #nav .tabs li a.selected { background-color: #08d; } /* Accolades ----------------------------------------*/ #accolades { margin: 20px 0; } #accolades .accolade { background: url('/images/accolade-star.png') no-repeat left center; padding: 0 0 0 60px; min-height: 48px; font-weight: bold; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; } #showcase .detail { font-size: 13px; } .app-end { clear: both; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2, #showcase .app h3 { font-size: 24px; font-weight: normal; margin: 0 0 12px 0; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h3.appslogan { color: #09f; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; + height: 50px; } -#showcase .app .appstore-badge { - padding: 0; -} - -#showcase .app div.android-info { - float: right; - width: 220px; - font-size: 12px; - color: #666; +#showcase .app .appstore-badge, +#showcase .app .android-badge { + padding: 0 10px 0 0; + float: left; } -#showcase .app div.android-info a { - color: #666; -} /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { #main { padding: 0; margin: 0; background-color: white; position: relative; -moz-box-shadow: 0 0 0 #333; -webkit-box-shadow: 0 0 0 #333; box-shadow: 0 0 0 #333; } } diff --git a/src/content/index.rhtml b/src/content/index.rhtml index 42e0c8b..940e90a 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,65 +1,58 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img border="0" src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2><a href="<%= app[:itunes_url] %>"><%= app[:name] %></a></h2> <h3 class="appslogan"><%= app[:slogan]%></h3> <% if app[:accolades] %> <div id="accolades"> <% for accolade in app[:accolades] %> <div class="accolade"><%= accolade %></div> <% end %> </div> <% end %> <% for para in app[:description] %> <p><%= para %></p> <% end %> <div class="install-links"> - <% if app[:android_package] %> - <div class="android-info"> - <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> - <br> - To install on Android, search the marketplace for <%= app[:name] %> or scan - <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> - </div> - <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> + <% if app[:android_package] %> + <div class="android-badge"> + <a href="https://market.android.com/details?id=<%= app[:android_package] %>"><img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android" border="0"></a> + </div> + <% end %> </div> - <% if app[:android_package] %> - <div style="clear: right"> </div> - <% end %> - - + <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"> </div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img border="0" src="/images/page-button-next.png"></a></div> </div><!-- #showcase -->
simonwhitaker/goo-website
0350c4176f3683215b75dc5da1c6741e986235a8
Removing Disqus integration
diff --git a/src/content/css/blog.css b/src/content/css/blog.css index 06af9e9..33885f7 100644 --- a/src/content/css/blog.css +++ b/src/content/css/blog.css @@ -1,221 +1,226 @@ @import url('base.css'); body { background-color: #eee; max-width: 1200px; } #header { border-bottom: 1px solid #444; } #content { /* background-color: #000;*/ margin-right: 220px; color: #333; } #slogan { color: #666; } /* Code ----------------------------------------*/ pre, code { font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 14px; /* color: #eee;*/ } pre, blockquote { margin: 0; padding: 12px; background-color: #ddd; border-radius: 5px; } /* Blog article navigation */ .blog-nav { margin: 12px 0; font-size: 13px; } .blog-nav .nav { padding: 0; margin: 0; } /* Misc blog formatting */ h1 { color: #09f; font-size: 33px; line-height: 1.1em; } h2 { color: #333; font-size: 28px; font-weight: normal; } h3 { color: #333; font-size: 20px; font-weight: normal; } .meta { /* color: #666;*/ font-style: italic; } +.twitter { + font-style: italic; + color: #666; +} + blockquote { padding: 20px 20px 20px 70px; background-image: url(../images/open-quote.png); background-repeat: no-repeat; } a[href] { color: #08d; } /* Comments */ .comments { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #777; } /* Latest posts */ #sidebar { float: right; width: 200px; padding: 20px 10px; margin: 0; font-size: 13px; } #sidebar a { color: #666; } #sidebar a:hover { color: #09f; } #sidebar .subscribe a { background-image: url("/images/feed-icon-14x14.png"); background-position: right 0; background-repeat: no-repeat; padding-right: 17px; } #sidebar h2 { color: #444; font-size: 20px; text-transform: uppercase; padding: 0; } #sidebar ul { margin: 0; padding: 0; } #sidebar li { display: block; padding: 0; } #sidebar li a { display: block; padding: 5px 0; } #sidebar li a.selected { font-weight: bold; } img.framed { border-color: #666; } #footer { clear: both; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-image: none; } code { display: block; max-width: 480px; overflow: hidden; } img { max-width: 400px; margin: 6px 0; padding: 0; } img.framed { border-width: 0; padding: 0; margin: 6px 0; } #sidebar { display: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; border-width: 0; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 10px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } } \ No newline at end of file diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index c739776..184561c 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,112 +1,97 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <script type="text/javascript" src="http://use.typekit.com/osv2fuk.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta name="viewport" content="width=device-width"> <meta name = "format-detection" content = "telephone=no"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Thoughts on developing fantastic apps for iPhone, iPad and iPod Touch </div> </div> <!-- Sidebar --> <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> <% end %> <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> <% end %> <div class="blog-content"> <%= yield %> </div> + + <div class="twitter"> + <p>To comment on this post, drop me a line <a href="http://twitter.com/s1mn/">on Twitter</a>.</p> + </div> <!-- Previous / next nav --> <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> </div> <% end %> - - <% if @item[:created_at] %> - <div class="comments"> - <h2>Comments</h2> - <div id="disqus_thread"></div> - <script type="text/javascript"> - /** - * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] - */ - (function() { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://goosoftware.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - })(); - </script> - <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=goosoftware">comments powered by Disqus.</a></noscript> - <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> - </div> - <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
630a098188b41c32ec51e8d2823c9ffd15c174b7
Added link to NMA awards in iBreastCheck details
diff --git a/src/content/index.yaml b/src/content/index.yaml index fb1a2d8..02b764a 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,92 +1,92 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png accolades: - > Named by Apple as one of the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best apps of 2011</a> in the UK App Store description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png accolades: - - > Winner, Charity and Voluntary Sector<br>NMA Awards 2011 + - > Winner, Charity and Voluntary Sector<br><a href="http://www.nmaawards.co.uk/winners2011.aspx">NMA Awards 2011</a> description: - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
eb1c794f7fb569ded9dfffdbcf0b28f4f1465058
Added support for accolades, in use for Oxford Uni and iBreastCheck
diff --git a/artwork/accolade-star.opacity b/artwork/accolade-star.opacity new file mode 100644 index 0000000..eb0b3c4 Binary files /dev/null and b/artwork/accolade-star.opacity differ diff --git a/src/content/css/goo.css b/src/content/css/goo.css index f21555d..20656b7 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,270 +1,284 @@ @import url('base.css'); body { max-width: 980px; } #main { padding: 0; margin: 0 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 24px; left: 130px; top: 140px; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 15px 5px 20px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } #nav .tabs li a:hover { background-color: #3C4200; } #nav .tabs li a.selected { background-color: #08d; } +/* Accolades +----------------------------------------*/ + +#accolades { + margin: 20px 0; +} + +#accolades .accolade { + background: url('/images/accolade-star.png') no-repeat left center; + padding: 0 0 0 60px; + min-height: 48px; + font-weight: bold; +} + /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; } #showcase .detail { font-size: 13px; } .app-end { clear: both; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2, #showcase .app h3 { font-size: 24px; font-weight: normal; margin: 0 0 12px 0; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h3.appslogan { color: #09f; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { #main { padding: 0; margin: 0; background-color: white; position: relative; -moz-box-shadow: 0 0 0 #333; -webkit-box-shadow: 0 0 0 #333; box-shadow: 0 0 0 #333; } } diff --git a/src/content/images/accolade-star.png b/src/content/images/accolade-star.png new file mode 100644 index 0000000..99eaa7d Binary files /dev/null and b/src/content/images/accolade-star.png differ diff --git a/src/content/index.rhtml b/src/content/index.rhtml index 033b23c..42e0c8b 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,58 +1,65 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img border="0" src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2><a href="<%= app[:itunes_url] %>"><%= app[:name] %></a></h2> <h3 class="appslogan"><%= app[:slogan]%></h3> - <% for desc in app[:description]%> - <p><%= desc %></p> + <% if app[:accolades] %> + <div id="accolades"> + <% for accolade in app[:accolades] %> + <div class="accolade"><%= accolade %></div> + <% end %> + </div> + <% end %> + <% for para in app[:description] %> + <p><%= para %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> <br> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> </div> <% if app[:android_package] %> <div style="clear: right"> </div> <% end %> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"> </div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img border="0" src="/images/page-button-next.png"></a></div> </div><!-- #showcase --> diff --git a/src/content/index.yaml b/src/content/index.yaml index 8044d02..fb1a2d8 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,88 +1,92 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png + accolades: + - > Named by Apple as one of the + <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best + apps of 2011</a> in the UK App Store description: - - > <b>Chosen by Apple as one of the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best apps of 2011</a> in the UK App Store!</b> - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png + accolades: + - > Winner, Charity and Voluntary Sector<br>NMA Awards 2011 description: - - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
375b4e73773d8121bb174fa82262466d45cc2a4a
Added link to Rewind 2011 page in iTunes
diff --git a/src/content/index.yaml b/src/content/index.yaml index 126a963..8044d02 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,87 +1,88 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png description: + - > <b>Chosen by Apple as one of the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?id=480282506">best apps of 2011</a> in the UK App Store!</b> - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
399b6e6d517534b850eb33836154762a5c77b42e
Set border=0 on page control links
diff --git a/src/content/index.rhtml b/src/content/index.rhtml index ca14f1b..033b23c 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,58 +1,58 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> - <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> + <div id="prev" class="page-control"><a href="#"><img border="0" src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2><a href="<%= app[:itunes_url] %>"><%= app[:name] %></a></h2> <h3 class="appslogan"><%= app[:slogan]%></h3> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> <br> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> </div> <% if app[:android_package] %> <div style="clear: right"> </div> <% end %> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"> </div> </div> <% end %> </div><!-- #apps --> - <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> + <div id="next" class="page-control"><a href="#"><img border="0" src="/images/page-button-next.png"></a></div> </div><!-- #showcase -->
simonwhitaker/goo-website
de1b2d7eaf6145f6d5a0b135f0161400e0935dd6
More tweakage
diff --git a/src/content/blog.rhtml b/src/content/blog.rhtml index 1186e97..ab9c212 100644 --- a/src/content/blog.rhtml +++ b/src/content/blog.rhtml @@ -1,16 +1,14 @@ --- title: Latest blog articles --- -<div id="content"> - <!-- <h1>Latest blog articles</h1> --> +<!-- <h1>Latest blog articles</h1> --> - <ul class="blog-items"> - <% for article in sorted_articles %> - <li> - <span class="date"><%= article[:created_at]%></span> - <a href="<%= article.path %>"><%= article[:title] %></a> - </li> - <% end %> - </ul> -</div> +<ul class="blog-items"> + <% for article in sorted_articles %> + <li> + <a href="<%= article.path %>"><%= article[:title] %></a> + <span class="date">(<%= article[:created_at]%>)</span> + </li> + <% end %> +</ul> diff --git a/src/content/css/goo.css b/src/content/css/goo.css index a1c2fa4..f21555d 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,271 +1,270 @@ @import url('base.css'); body { max-width: 980px; } #main { padding: 0; margin: 0 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 24px; left: 130px; top: 140px; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 15px 5px 20px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } #nav .tabs li a:hover { background-color: #3C4200; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; - height: 500px; } #showcase .detail { font-size: 13px; } .app-end { - clear: left; + clear: both; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2, #showcase .app h3 { font-size: 24px; font-weight: normal; margin: 0 0 12px 0; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h3.appslogan { color: #09f; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { #main { padding: 0; margin: 0; background-color: white; position: relative; -moz-box-shadow: 0 0 0 #333; -webkit-box-shadow: 0 0 0 #333; box-shadow: 0 0 0 #333; } } diff --git a/src/content/index.rhtml b/src/content/index.rhtml index c39aa5e..ca14f1b 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,55 +1,58 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2><a href="<%= app[:itunes_url] %>"><%= app[:name] %></a></h2> <h3 class="appslogan"><%= app[:slogan]%></h3> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> <br> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> </div> + <% if app[:android_package] %> + <div style="clear: right"> </div> + <% end %> + <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> - <div style="clear:right"> </div> - <div class="app-end"></div> + <div class="app-end"> </div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> </div><!-- #showcase --> diff --git a/src/content/js/showcase.js b/src/content/js/showcase.js index 4c82d3a..441cd86 100644 --- a/src/content/js/showcase.js +++ b/src/content/js/showcase.js @@ -1,109 +1,111 @@ function get_current_page() { return Math.round($('#apps').scrollLeft() / $('#apps').width()); } function scroll_to_page(page, animate) { var page_width = $('#apps').width(); var prev_page = get_current_page() var attr = {'scrollLeft': page_width * page}; // Do the scrolling if (animate) { $('#apps').animate(attr, 300, function(){ // animation complete update_paging_controls(); }); } else { $('#apps').attr(attr); update_paging_controls(); } $('.pager').each(function(index){ $(this).toggleClass('selected', index == page); }); } function update_paging_controls() { var current_page = get_current_page(); var last_page = $('.app').length - 1; var OPACITY_FADED = 0.3; var OPACITY_STD = 1.0; var target_opacity_prev = current_page == 0 ? OPACITY_FADED : OPACITY_STD; var target_opacity_next = current_page == last_page ? OPACITY_FADED : OPACITY_STD; if (Math.abs($('.page-control#prev img').css('opacity') - target_opacity_prev) > 0.5) { $('.page-control#prev img').animate({'opacity': target_opacity_prev}, 150); } if (Math.abs($('.page-control#next img').css('opacity') - target_opacity_next) > 0.5) { $('.page-control#next img').animate({'opacity': target_opacity_next}, 150); } if (current_page > 0) { prev_app_id = $('.app').get(current_page - 1).id; $('.page-control#prev a').attr('href', '#!' + prev_app_id); } else { $('.page-control#prev a').attr('href', 'javascript:void(0);'); } if (current_page < last_page) { next_app_id = $('.app').get(current_page + 1).id; $('.page-control#next a').attr('href', '#!' + next_app_id); } else { $('.page-control#next a').attr('href', 'javascript:void(0);'); } } function prev_page() { var current_page = get_current_page(); if (current_page == 0) return scroll_to_page(current_page - 1, true); } function next_page() { var current_page = get_current_page(); var last_page = $('.app').length - 1; if (current_page == last_page) return scroll_to_page(current_page + 1, true); } $(document).ready(function () { var w = $('#apps').width(); // don't run on the iPhone or iPod Touch if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { return; } - + + $('#apps').css('height', 500); + // First, layout the apps var PADDING = 30; $('.app').each(function(index) { $(this).css({ 'position': 'absolute', 'top': 0, 'left': (w * index) + 'px', 'width': (w - PADDING * 2) + 'px', 'padding': PADDING + 'px', }); }); $('#apps').css('overflow','hidden'); // Now make the page-control buttons visible $('.page-control#next').click(function(){ next_page(); }); $('.page-control#prev').click(function(el){ prev_page(); }); $('.page-control').show(); // Handle #! URLs if (r = location.href.match('#!(.+)')) { var app = $('#' + r[1]); var index = $('.app').index(app); if (index >= 0) scroll_to_page(index, false); else scroll_to_page(0); } else { scroll_to_page(0); } }); diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index 1f070f0..c739776 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,110 +1,112 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <script type="text/javascript" src="http://use.typekit.com/osv2fuk.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta name="viewport" content="width=device-width"> + <meta name = "format-detection" content = "telephone=no"> + <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Thoughts on developing fantastic apps for iPhone, iPad and iPod Touch </div> </div> <!-- Sidebar --> <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> <% end %> <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> <% end %> <div class="blog-content"> <%= yield %> </div> <!-- Previous / next nav --> <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> </div> <% end %> <% if @item[:created_at] %> <div class="comments"> <h2>Comments</h2> <div id="disqus_thread"></div> <script type="text/javascript"> /** * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://goosoftware.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=goosoftware">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </div> <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
0fecb18f78c0c3e537c5f51fb22150760cef9d23
Pimping the blog
diff --git a/src/content/css/blog.css b/src/content/css/blog.css index e89e884..06af9e9 100644 --- a/src/content/css/blog.css +++ b/src/content/css/blog.css @@ -1,251 +1,221 @@ @import url('base.css'); body { - background-color: #000; + background-color: #eee; max-width: 1200px; } #header { border-bottom: 1px solid #444; } #content { - background-color: #000; +/* background-color: #000;*/ margin-right: 220px; - color: #999; + color: #333; } #slogan { color: #666; } /* Code ----------------------------------------*/ pre, code { font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 14px; - color: #fff; +/* color: #eee;*/ } -pre { - margin: 30px; +pre, blockquote { + margin: 0; padding: 12px; - background-color: #333; - border-radius: 12px; -} - -/* Monochrome nav */ - -#nav { - top: 20px; -} - -#nav .tabs li a { - background-color: #aaa; - color: white; -} - -#nav .tabs li a:hover { - background-color: #555; - color: white; -} - -#nav .tabs li a.selected { - background-color: #08d; + background-color: #ddd; + border-radius: 5px; } /* Blog article navigation */ .blog-nav { margin: 12px 0; font-size: 13px; } .blog-nav .nav { padding: 0; margin: 0; } -.blog-nav .nav+.nav { - border-left: 1px dotted #444; - padding-left: 10px; - margin-left: 10px; -} - /* Misc blog formatting */ h1 { color: #09f; font-size: 33px; line-height: 1.1em; } h2 { - color: #fff; + color: #333; font-size: 28px; font-weight: normal; } h3 { - color: #fff; + color: #333; font-size: 20px; font-weight: normal; } .meta { - color: #666; +/* color: #666;*/ font-style: italic; } blockquote { - margin: 30px; padding: 20px 20px 20px 70px; - background-color: #333; - border-radius: 12px; - color: #ccc; background-image: url(../images/open-quote.png); background-repeat: no-repeat; } a[href] { color: #08d; } /* Comments */ .comments { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #777; } /* Latest posts */ #sidebar { float: right; width: 200px; padding: 20px 10px; margin: 0; font-size: 13px; } #sidebar a { - color: #bbb; + color: #666; } #sidebar a:hover { color: #09f; } #sidebar .subscribe a { background-image: url("/images/feed-icon-14x14.png"); background-position: right 0; background-repeat: no-repeat; padding-right: 17px; } #sidebar h2 { - color: #999; + color: #444; font-size: 20px; text-transform: uppercase; padding: 0; } #sidebar ul { margin: 0; padding: 0; } #sidebar li { display: block; padding: 0; } #sidebar li a { display: block; padding: 5px 0; } #sidebar li a.selected { font-weight: bold; } img.framed { border-color: #666; } #footer { clear: both; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-image: none; } code { display: block; max-width: 480px; overflow: hidden; } img { max-width: 400px; margin: 6px 0; padding: 0; } img.framed { border-width: 0; padding: 0; margin: 6px 0; } #sidebar { display: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; border-width: 0; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 10px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } } \ No newline at end of file diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index f432550..1f070f0 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,108 +1,110 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> + <script type="text/javascript" src="http://use.typekit.com/osv2fuk.js"></script> + <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Thoughts on developing fantastic apps for iPhone, iPad and iPod Touch </div> </div> <!-- Sidebar --> <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> <% end %> <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> <% end %> <div class="blog-content"> <%= yield %> </div> <!-- Previous / next nav --> <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> </div> <% end %> <% if @item[:created_at] %> <div class="comments"> <h2>Comments</h2> <div id="disqus_thread"></div> <script type="text/javascript"> /** * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://goosoftware.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=goosoftware">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </div> <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
b365b6ab90d40bfb7fa682ff03d4a31b1fb3d5bc
Updating to use Typekit
diff --git a/src/content/css/base.css b/src/content/css/base.css index be9fe52..ebb699c 100644 --- a/src/content/css/base.css +++ b/src/content/css/base.css @@ -1,108 +1,104 @@ p, div, span, td, th, li { line-height: 1.3em; } body { - font-family: Helvetica, Arial, sans-serif; + font-family: museo-sans, sans-serif; margin: 0 auto; background-color: #aaa; + color: #555; } p { line-height: 1.4em; } h1 { - font-size: 22px; - font-weight: normal; + font-size: 32px; + color: #000; } h2 { - font-size: 17px; + font-size: 22px; } h3 { - font-size: 13px; + font-size: 16px; } h1, h2, h3 { - font-family: "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -h1 { + font-family: rooney-web, sans-serif; } a[href] { color: #09f; } a:visited { color: #0F3D74; } /* Common bits and bobs ----------------------------------------*/ p img.icon[height="16"] { vertical-align: -2px; margin-right: 3px; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; - font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Tabs ----------------------------------------*/ ul.tabs li { list-style-type: none; } /* Content ----------------------------------------*/ #content { - color: #333; padding: 0 30px 20px 30px; } img.framed { border: 1px solid #ccc; padding: 3px; margin: 8px; } /* Footer ----------------------------------------*/ #footer { padding: 20px 30px; clear: left; color: #888; background-color: #f0f0f0; border-top: 1px solid #ddd; font-size: 11px; text-shadow: #fff 0 1px 1px; } diff --git a/src/content/css/goo.css b/src/content/css/goo.css index c3329b3..a1c2fa4 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,277 +1,271 @@ @import url('base.css'); body { max-width: 980px; } #main { padding: 0; margin: 0 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; - font-size: 17px; + font-size: 24px; left: 130px; top: 140px; - font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 15px 5px 20px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } #nav .tabs li a:hover { background-color: #3C4200; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; - color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { - color: #222 ; font-size: 13px; } .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } -#showcase .app h2 { - margin-top: 0; - font-size: 22px; - font-weight: bold; +#showcase .app h2, #showcase .app h3 { + font-size: 24px; + font-weight: normal; + margin: 0 0 12px 0; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } -#showcase .app h2 .appslogan { - color: #09f !important; - font-weight: normal; - display: block; +#showcase .app h3.appslogan { + color: #09f; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; - color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { #main { padding: 0; margin: 0; background-color: white; position: relative; -moz-box-shadow: 0 0 0 #333; -webkit-box-shadow: 0 0 0 #333; box-shadow: 0 0 0 #333; } } diff --git a/src/content/index.rhtml b/src/content/index.rhtml index 91da0fe..c39aa5e 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,57 +1,55 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> - <h2> - <a href="<%= app[:itunes_url] %>"><%= app[:name] %></a> - <span class="appslogan"><%= app[:slogan]%></span> - </h2> + <h2><a href="<%= app[:itunes_url] %>"><%= app[:name] %></a></h2> + <h3 class="appslogan"><%= app[:slogan]%></h3> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> <br> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> </div> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div style="clear:right"> </div> <div class="app-end"></div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> </div><!-- #showcase --> diff --git a/src/layouts/goo.rhtml b/src/layouts/goo.rhtml index e3d205a..883c5d7 100644 --- a/src/layouts/goo.rhtml +++ b/src/layouts/goo.rhtml @@ -1,44 +1,46 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> + <script type="text/javascript" src="http://use.typekit.com/osv2fuk.js"></script> + <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software - <%= @item[:title] %> </title> <link rel="stylesheet" href="/css/goo.css" type="text/css" media="screen" charset="utf-8"> </head> <body> <div id="main"> <div id="header"> <a href="/"><img src="/images/goo-logo.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Fantastic apps for iPhone, iPad and iPod Touch </div> </div> <div id="nav"> <ul class="tabs"> <% for nl in navlinks %> <li> <a <% if @item.identifier == nl[:url] %>class="selected"<% end %> href="<%= nl[:url] %>"><%= nl[:text] %></a> </li> <% end %> </ul> </div> <%= yield %> <div id="footer"> Goo Software Ltd, registered in England and Wales with company number 7242280. Registered address: 88 Lucerne Avenue, Bicester OX26 3EL, UK </div> </div><!-- #main --> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </body> </html>
simonwhitaker/goo-website
9b5174168e62f5393455870a87aad1202bfedfb5
Added spacing
diff --git a/src/content/index.yaml b/src/content/index.yaml index b82b932..126a963 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,87 +1,87 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - - > Sing along to over 7,500 songs with this fun iPad - app from Lucky Voice, the UK's number one online + - > Sing along to over 7,500 songs with this fun iPad + app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
9a319bb94ec92c6343b4785d1f81173fcea3bea5
Making everything look nice on iPad and iPhone
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 86ae7de..c3329b3 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,403 +1,277 @@ @import url('base.css'); body { - max-width: 960px; + max-width: 980px; } #main { padding: 0; - margin: 20px 0 30px 0; + margin: 0 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 15px 5px 20px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } #nav .tabs li a:hover { background-color: #3C4200; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { color: #222 ; font-size: 13px; } .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f !important; font-weight: normal; display: block; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } - @media screen and (max-device-width: 480px) { - body { - width: 480px; - margin: 0; - padding: 0; - background-color: #fff; - background-image: none; - } - - p, div, span, li { - font-size: 20px; - } - - h1 { - font-size: 28px; - font-weight: normal; - } - - h2 { - font-size: 24px; - } - - h3 { - font-size: 20px; - } - - #header { - height: 160px; - } - #main { - margin: 0; padding: 0; - background-image: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - - } - - #logo { - left: 10px; - top: 20px; - } - - #slogan { - left: 120px; - width: 340px; - top: 120px; - } - #nav { - position: relative; - top: 0; - left: 0; - padding: 0; - margin: 10px 0; - } - - #nav .tabs { - text-align: left; - padding: 0; - margin: 0 20px; - } - - #nav .tabs li { - float: left; - font-size: 20px; - } - - #nav .tabs li+li { - margin-left: 1px; - } - - #content { - clear: both; - padding: 0 20px; - margin: 60px 0 0 0; - width: 440px; - } - - #showcase { - width: 440px; - border-radius: 0; - -moz-border-radius: 0; - padding: 0 20px; - margin: 20px 0 0 0; - } - - #showcase #apps { - width: 100%; - border-width: 0; - height: auto; - } - - #showcase .app h2 a { - } - - #showcase .app+.app { - border-top: 1px solid #333; - } - - #showcase .app { margin: 0; - padding: 30px 0px; - } - - #showcase .app img.screenshot { - width: 120px; - } - - #showcase .app.ipad .description, - #showcase .app .description { - margin-left: 140px; - padding: 0px; - } - - #footer { - margin: 0; - padding: 20px 10px; - text-align: center; - font-size: 10px; - } - - #footer a { - } - - .portrait { - float: left; - width: 60px; - } - - .biog { - margin-left: 80px; + background-color: white; + position: relative; + -moz-box-shadow: 0 0 0 #333; + -webkit-box-shadow: 0 0 0 #333; + box-shadow: 0 0 0 #333; } - -} \ No newline at end of file +} diff --git a/src/content/js/showcase.js b/src/content/js/showcase.js index d5b28aa..4c82d3a 100644 --- a/src/content/js/showcase.js +++ b/src/content/js/showcase.js @@ -1,105 +1,109 @@ function get_current_page() { return Math.round($('#apps').scrollLeft() / $('#apps').width()); } function scroll_to_page(page, animate) { var page_width = $('#apps').width(); var prev_page = get_current_page() var attr = {'scrollLeft': page_width * page}; // Do the scrolling if (animate) { $('#apps').animate(attr, 300, function(){ // animation complete update_paging_controls(); }); } else { $('#apps').attr(attr); update_paging_controls(); } $('.pager').each(function(index){ $(this).toggleClass('selected', index == page); }); } function update_paging_controls() { var current_page = get_current_page(); var last_page = $('.app').length - 1; var OPACITY_FADED = 0.3; var OPACITY_STD = 1.0; var target_opacity_prev = current_page == 0 ? OPACITY_FADED : OPACITY_STD; var target_opacity_next = current_page == last_page ? OPACITY_FADED : OPACITY_STD; if (Math.abs($('.page-control#prev img').css('opacity') - target_opacity_prev) > 0.5) { $('.page-control#prev img').animate({'opacity': target_opacity_prev}, 150); } if (Math.abs($('.page-control#next img').css('opacity') - target_opacity_next) > 0.5) { $('.page-control#next img').animate({'opacity': target_opacity_next}, 150); } if (current_page > 0) { prev_app_id = $('.app').get(current_page - 1).id; $('.page-control#prev a').attr('href', '#!' + prev_app_id); } else { $('.page-control#prev a').attr('href', 'javascript:void(0);'); } if (current_page < last_page) { next_app_id = $('.app').get(current_page + 1).id; $('.page-control#next a').attr('href', '#!' + next_app_id); } else { $('.page-control#next a').attr('href', 'javascript:void(0);'); } } function prev_page() { var current_page = get_current_page(); if (current_page == 0) return scroll_to_page(current_page - 1, true); } function next_page() { var current_page = get_current_page(); var last_page = $('.app').length - 1; if (current_page == last_page) return scroll_to_page(current_page + 1, true); } $(document).ready(function () { var w = $('#apps').width(); - // don't run on the iPhone - if (w > 480) { - // First, layout the apps - var PADDING = 30; - $('.app').each(function(index) { - $(this).css({ - 'position': 'absolute', - 'top': 0, - 'left': (w * index) + 'px', - 'width': (w - PADDING * 2) + 'px', - 'padding': PADDING + 'px', - }); - }); - $('#apps').css('overflow','hidden'); - - // Now make the page-control buttons visible - $('.page-control#next').click(function(){ next_page(); }); - $('.page-control#prev').click(function(el){ prev_page(); }); - $('.page-control').show(); + // don't run on the iPhone or iPod Touch + if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { + return; } + + // First, layout the apps + var PADDING = 30; + $('.app').each(function(index) { + $(this).css({ + 'position': 'absolute', + 'top': 0, + 'left': (w * index) + 'px', + 'width': (w - PADDING * 2) + 'px', + 'padding': PADDING + 'px', + }); + }); + $('#apps').css('overflow','hidden'); + + // Now make the page-control buttons visible + $('.page-control#next').click(function(){ next_page(); }); + $('.page-control#prev').click(function(el){ prev_page(); }); + $('.page-control').show(); + + // Handle #! URLs if (r = location.href.match('#!(.+)')) { var app = $('#' + r[1]); var index = $('.app').index(app); if (index >= 0) scroll_to_page(index, false); else scroll_to_page(0); } else { scroll_to_page(0); } }); diff --git a/src/layouts/goo.rhtml b/src/layouts/goo.rhtml index 03ebb57..e3d205a 100644 --- a/src/layouts/goo.rhtml +++ b/src/layouts/goo.rhtml @@ -1,45 +1,44 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> - <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software - <%= @item[:title] %> </title> <link rel="stylesheet" href="/css/goo.css" type="text/css" media="screen" charset="utf-8"> </head> <body> <div id="main"> <div id="header"> <a href="/"><img src="/images/goo-logo.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Fantastic apps for iPhone, iPad and iPod Touch </div> </div> <div id="nav"> <ul class="tabs"> <% for nl in navlinks %> <li> <a <% if @item.identifier == nl[:url] %>class="selected"<% end %> href="<%= nl[:url] %>"><%= nl[:text] %></a> </li> <% end %> </ul> </div> <%= yield %> <div id="footer"> Goo Software Ltd, registered in England and Wales with company number 7242280. Registered address: 88 Lucerne Avenue, Bicester OX26 3EL, UK </div> </div><!-- #main --> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </body> </html>
simonwhitaker/goo-website
d0b5c67d1ce989e26ce886935129c9668fd1e29c
Further tweaks
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index c326c55..86ae7de 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,400 +1,403 @@ @import url('base.css'); body { max-width: 960px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { - margin-bottom: 12px; + margin-bottom: 16px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; - padding: 5px 10px; + padding: 5px 15px 5px 20px; + -webkit-border-top-left-radius: 20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-topleft: 20px; + -moz-border-radius-bottomleft: 20px; + border-top-left-radius: 20px; + border-bottom-left-radius: 20px; } #nav .tabs li a:hover { - text-decoration: none; background-color: #3C4200; - color: white; - padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { color: #222 ; font-size: 13px; } .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f !important; font-weight: normal; display: block; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file diff --git a/src/content/images/goo-logo-orange.png b/src/content/images/goo-logo-orange.png new file mode 100644 index 0000000..170616a Binary files /dev/null and b/src/content/images/goo-logo-orange.png differ diff --git a/src/layouts/goo.rhtml b/src/layouts/goo.rhtml index bf38dd5..03ebb57 100644 --- a/src/layouts/goo.rhtml +++ b/src/layouts/goo.rhtml @@ -1,45 +1,45 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software - <%= @item[:title] %> </title> <link rel="stylesheet" href="/css/goo.css" type="text/css" media="screen" charset="utf-8"> - <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> - <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> - <% if @item[:js_imports] %> - <% for js in @item[:js_imports] %> - <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> - <% end %> - <% end %> </head> <body> <div id="main"> <div id="header"> <a href="/"><img src="/images/goo-logo.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Fantastic apps for iPhone, iPad and iPod Touch </div> </div> <div id="nav"> <ul class="tabs"> <% for nl in navlinks %> <li> <a <% if @item.identifier == nl[:url] %>class="selected"<% end %> href="<%= nl[:url] %>"><%= nl[:text] %></a> </li> <% end %> </ul> </div> <%= yield %> <div id="footer"> Goo Software Ltd, registered in England and Wales with company number 7242280. Registered address: 88 Lucerne Avenue, Bicester OX26 3EL, UK </div> </div><!-- #main --> + <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> + <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> + <% if @item[:js_imports] %> + <% for js in @item[:js_imports] %> + <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> + <% end %> + <% end %> </body> </html> diff --git a/src/lib/navlinks.rb b/src/lib/navlinks.rb index 38cbdb2..f8c951f 100644 --- a/src/lib/navlinks.rb +++ b/src/lib/navlinks.rb @@ -1,9 +1,9 @@ def navlinks return [ { :text => "Home", :url => "/" }, { :text => "Contact", :url => "/contact/" }, { :text => "About", :url => "/about/" }, - { :text => "Help", :url => "/help/" }, + # { :text => "Help", :url => "/help/" }, { :text => "Blog", :url => "/blog/" }, ] end \ No newline at end of file
simonwhitaker/goo-website
e9ed2cd1bb7aacae389f819da0f634a7d7aaa443
Fixing indent on app slogan
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 51b5c16..c326c55 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,401 +1,400 @@ @import url('base.css'); body { max-width: 960px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 12px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 10px; } #nav .tabs li a:hover { text-decoration: none; background-color: #3C4200; color: white; padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { color: #222 ; font-size: 13px; } .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f !important; font-weight: normal; - margin-left: 2px; display: block; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; color: #666; } #showcase .app div.android-info a { color: #666; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file
simonwhitaker/goo-website
1fcf35eabd4bdecd640817274f19e0c0a4853d7c
Misc tweaks
diff --git a/artwork/Habilis logo.opacity b/artwork/Habilis logo.opacity deleted file mode 100644 index c396325..0000000 Binary files a/artwork/Habilis logo.opacity and /dev/null differ diff --git a/artwork/app-bg.psd b/artwork/app-bg.psd deleted file mode 100644 index f5f678c..0000000 Binary files a/artwork/app-bg.psd and /dev/null differ diff --git a/src/content/css/base.css b/src/content/css/base.css index 717434b..be9fe52 100644 --- a/src/content/css/base.css +++ b/src/content/css/base.css @@ -1,108 +1,108 @@ p, div, span, td, th, li { line-height: 1.3em; } body { font-family: Helvetica, Arial, sans-serif; margin: 0 auto; background-color: #aaa; } p { line-height: 1.4em; } h1 { font-size: 22px; font-weight: normal; } h2 { font-size: 17px; } h3 { font-size: 13px; } h1, h2, h3 { font-family: "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif; } h1 { } a[href] { - color: #667200; + color: #09f; } a:visited { - color: #3C4200; + color: #0F3D74; } /* Common bits and bobs ----------------------------------------*/ p img.icon[height="16"] { vertical-align: -2px; margin-right: 3px; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Tabs ----------------------------------------*/ ul.tabs li { list-style-type: none; } /* Content ----------------------------------------*/ #content { color: #333; padding: 0 30px 20px 30px; } img.framed { border: 1px solid #ccc; padding: 3px; margin: 8px; } /* Footer ----------------------------------------*/ #footer { padding: 20px 30px; clear: left; color: #888; background-color: #f0f0f0; border-top: 1px solid #ddd; font-size: 11px; text-shadow: #fff 0 1px 1px; } diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 6f0c4ed..51b5c16 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,435 +1,401 @@ @import url('base.css'); body { max-width: 960px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 12px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 10px; } #nav .tabs li a:hover { text-decoration: none; background-color: #3C4200; color: white; padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { color: #222 ; font-size: 13px; } -#showcase a { - color: #555; -} - .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f !important; font-weight: normal; margin-left: 2px; display: block; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; + color: #666; } -#showcase #page_control { - position: relative; - float: left; - height: 100%; - width: 150px; - top: 40px; - left: 0; - height: 100%; -} - -#showcase #page_control a { - display: block; - font-size: 15px; - color: white; - padding: 10px 10px; - text-align: left; - text-decoration: none; - border-top: 1px solid #666; - border-bottom: 1px solid #666; -} - -#showcase #page_control a.selected { - background-color: black; -} - -#showcase #page_control a+a { - border-top-width: 0; -} - -#showcase #page_control a:hover { - background-color: #09f; - color: white; +#showcase .app div.android-info a { + color: #666; } - /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file diff --git a/src/content/images/available-for-android.png b/src/content/images/available-for-android.png new file mode 100644 index 0000000..c295ae2 Binary files /dev/null and b/src/content/images/available-for-android.png differ diff --git a/src/content/index.rhtml b/src/content/index.rhtml index fa5652c..91da0fe 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,57 +1,57 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2> <a href="<%= app[:itunes_url] %>"><%= app[:name] %></a> <span class="appslogan"><%= app[:slogan]%></span> </h2> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> + <img src="/images/available-for-android.png" width="129" height="45" alt="Available for Android"> + <br> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> - <% if app[:itunes_url] %> <div class="appstore-badge"> - <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" alt="App Store Badge Clipped" border="0"></a> + <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" width="130" height="45" alt="Available on the App Store" border="0"></a> </div> <% end %> </div> - <div style="clear:right"> </div> - <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> + <div style="clear:right"> </div> <div class="app-end"></div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> </div><!-- #showcase --> diff --git a/src/content/index.yaml b/src/content/index.yaml index 7a47192..b82b932 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,87 +1,87 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs with this fun iPad app from Lucky Voice, the UK's number one online karaoke service. - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> support means you don't have to use your hairbrush! - client: Lucky Voice Ltd + client: <a href="http://www.luckyvoice.com/">Lucky Voice Ltd</a> platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> - client: Beggars Group Ltd + client: <a href="http://www.beggars.com/">Beggars Group Ltd</a> platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android"
simonwhitaker/goo-website
2e6ff779b77fb8b9b7970ab0f8dd775ab6352e64
Wording change
diff --git a/src/content/index.rhtml b/src/content/index.rhtml index 02914f8..fa5652c 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,57 +1,57 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> - We're a UK software house specialising in apps for iPhone, iPad and iPod Touch. Here's some of the stuff we've done. + We're a UK software house offering app development for iPhone, iPad and iPod Touch. Here are some of the apps we've developed. </p> </div> <div id="showcase"> <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> <a href="<%= app[:itunes_url] %>"> <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> </a> <div class="description"> <h2> <a href="<%= app[:itunes_url] %>"><%= app[:name] %></a> <span class="appslogan"><%= app[:slogan]%></span> </h2> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" alt="App Store Badge Clipped" border="0"></a> </div> <% end %> </div> <div style="clear:right"> </div> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"></div> </div> <% end %> </div><!-- #apps --> <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> </div><!-- #showcase -->
simonwhitaker/goo-website
7443dd075f490c4769134e7fa4fefe7098f5f174
Added more content to Lucky Voice entry
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 6adf5ee..6f0c4ed 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,434 +1,435 @@ @import url('base.css'); body { max-width: 960px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 12px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 10px; } #nav .tabs li a:hover { text-decoration: none; background-color: #3C4200; color: white; padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-repeat: no-repeat; color: #222; position: relative; width: 100%; } #apps { position: relative; margin: 0 auto; width: 800px; height: 500px; } #showcase .detail { color: #222 ; font-size: 13px; } #showcase a { color: #555; } .app-end { clear: left; } #showcase .page-control { position: absolute; top: 0; z-index: 1000; display: none; } #showcase #prev { left: 10px; } #showcase #next { right: 10px; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f !important; font-weight: normal; margin-left: 2px; + display: block; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; } #showcase #page_control { position: relative; float: left; height: 100%; width: 150px; top: 40px; left: 0; height: 100%; } #showcase #page_control a { display: block; font-size: 15px; color: white; padding: 10px 10px; text-align: left; text-decoration: none; border-top: 1px solid #666; border-bottom: 1px solid #666; } #showcase #page_control a.selected { background-color: black; } #showcase #page_control a+a { border-top-width: 0; } #showcase #page_control a:hover { background-color: #09f; color: white; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file diff --git a/src/content/index.yaml b/src/content/index.yaml index f6d23d7..7a47192 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,83 +1,87 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - - > Sing along to over 7,500 songs + - > Sing along to over 7,500 songs with this fun iPad + app from Lucky Voice, the UK's number one online + karaoke service. + - > <a href="http://www.ikmultimedia.com/irigmic/features/">iRig Mic</a> + support means you don't have to use your hairbrush! client: Lucky Voice Ltd platform: iPad class: ipad - name: The xx slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: Beggars Group Ltd platform: iPhone and iPod Touch - name: RSA Vision slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android" diff --git a/src/content/js/showcase.js b/src/content/js/showcase.js index 3c216a6..d5b28aa 100644 --- a/src/content/js/showcase.js +++ b/src/content/js/showcase.js @@ -1,105 +1,105 @@ function get_current_page() { return Math.round($('#apps').scrollLeft() / $('#apps').width()); } function scroll_to_page(page, animate) { var page_width = $('#apps').width(); var prev_page = get_current_page() var attr = {'scrollLeft': page_width * page}; // Do the scrolling if (animate) { $('#apps').animate(attr, 300, function(){ // animation complete update_paging_controls(); }); } else { $('#apps').attr(attr); update_paging_controls(); } $('.pager').each(function(index){ $(this).toggleClass('selected', index == page); }); } function update_paging_controls() { var current_page = get_current_page(); var last_page = $('.app').length - 1; var OPACITY_FADED = 0.3; var OPACITY_STD = 1.0; var target_opacity_prev = current_page == 0 ? OPACITY_FADED : OPACITY_STD; var target_opacity_next = current_page == last_page ? OPACITY_FADED : OPACITY_STD; if (Math.abs($('.page-control#prev img').css('opacity') - target_opacity_prev) > 0.5) { $('.page-control#prev img').animate({'opacity': target_opacity_prev}, 150); } if (Math.abs($('.page-control#next img').css('opacity') - target_opacity_next) > 0.5) { $('.page-control#next img').animate({'opacity': target_opacity_next}, 150); } if (current_page > 0) { prev_app_id = $('.app').get(current_page - 1).id; $('.page-control#prev a').attr('href', '#!' + prev_app_id); } else { - $('.page-control#prev a').attr('href', ''); + $('.page-control#prev a').attr('href', 'javascript:void(0);'); } if (current_page < last_page) { next_app_id = $('.app').get(current_page + 1).id; $('.page-control#next a').attr('href', '#!' + next_app_id); } else { - $('.page-control#next a').attr('href', ''); + $('.page-control#next a').attr('href', 'javascript:void(0);'); } } function prev_page() { var current_page = get_current_page(); if (current_page == 0) return scroll_to_page(current_page - 1, true); } function next_page() { var current_page = get_current_page(); var last_page = $('.app').length - 1; if (current_page == last_page) return scroll_to_page(current_page + 1, true); } $(document).ready(function () { var w = $('#apps').width(); // don't run on the iPhone if (w > 480) { // First, layout the apps var PADDING = 30; $('.app').each(function(index) { $(this).css({ 'position': 'absolute', 'top': 0, 'left': (w * index) + 'px', 'width': (w - PADDING * 2) + 'px', 'padding': PADDING + 'px', }); }); $('#apps').css('overflow','hidden'); // Now make the page-control buttons visible $('.page-control#next').click(function(){ next_page(); }); $('.page-control#prev').click(function(el){ prev_page(); }); $('.page-control').show(); } if (r = location.href.match('#!(.+)')) { var app = $('#' + r[1]); var index = $('.app').index(app); if (index >= 0) scroll_to_page(index, false); else scroll_to_page(0); } else { scroll_to_page(0); } });
simonwhitaker/goo-website
4f59e924e6f7fd5c1e4ad58cfb30aac5476a9abd
Moved arrow heads up a bit on paging controls
diff --git a/artwork/page-button.opacity b/artwork/page-button.opacity index f984610..66a8a3c 100644 Binary files a/artwork/page-button.opacity and b/artwork/page-button.opacity differ diff --git a/src/content/images/page-button-next.png b/src/content/images/page-button-next.png index 6508056..4e0e207 100644 Binary files a/src/content/images/page-button-next.png and b/src/content/images/page-button-next.png differ diff --git a/src/content/images/page-button-prev.png b/src/content/images/page-button-prev.png index a2de2e9..ecb1d7e 100644 Binary files a/src/content/images/page-button-prev.png and b/src/content/images/page-button-prev.png differ
simonwhitaker/goo-website
edcb0df60cc8fb2c60de65d1b9e9d308271bf595
Site revamp - got rid of dark background in portfolio and replaced app buttons with simple paging controls
diff --git a/artwork/page-button.opacity b/artwork/page-button.opacity new file mode 100644 index 0000000..f984610 Binary files /dev/null and b/artwork/page-button.opacity differ diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 39bee99..6adf5ee 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,423 +1,434 @@ @import url('base.css'); body { - width: 840px; + max-width: 960px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 12px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 10px; } #nav .tabs li a:hover { text-decoration: none; background-color: #3C4200; color: white; padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; - background-color: black; - background-image: url('../images/app-bg.png'); background-repeat: no-repeat; - color: #ddd; + color: #222; position: relative; width: 100%; } #apps { - border-left: 1px solid #666; position: relative; - margin: 0; - width: 689px; + margin: 0 auto; + width: 800px; height: 500px; } #showcase .detail { - color: #aaa; + color: #222 ; font-size: 13px; } #showcase a { - color: #fff; + color: #555; } .app-end { clear: left; } +#showcase .page-control { + position: absolute; + top: 0; + z-index: 1000; + display: none; +} + +#showcase #prev { + left: 10px; +} + +#showcase #next { + right: 10px; +} + #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; - color: #eee; + color: #222; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { - color: #09f; + color: #09f !important; font-weight: normal; - margin-left: 6px; + margin-left: 2px; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; } #showcase #page_control { position: relative; float: left; height: 100%; width: 150px; top: 40px; left: 0; height: 100%; } #showcase #page_control a { display: block; font-size: 15px; color: white; padding: 10px 10px; text-align: left; text-decoration: none; border-top: 1px solid #666; border-bottom: 1px solid #666; } #showcase #page_control a.selected { background-color: black; } #showcase #page_control a+a { border-top-width: 0; } #showcase #page_control a:hover { background-color: #09f; color: white; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; - background-color: black; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file diff --git a/src/content/images/app-bg.png b/src/content/images/app-bg.png deleted file mode 100644 index 8f47d3c..0000000 Binary files a/src/content/images/app-bg.png and /dev/null differ diff --git a/src/content/images/apps/bbc-bitesize.png b/src/content/images/apps/bbc-bitesize.png deleted file mode 100644 index 84fdd49..0000000 Binary files a/src/content/images/apps/bbc-bitesize.png and /dev/null differ diff --git a/src/content/images/apps/exam-countdown.png b/src/content/images/apps/exam-countdown.png deleted file mode 100644 index 6df9d68..0000000 Binary files a/src/content/images/apps/exam-countdown.png and /dev/null differ diff --git a/src/content/images/apps/sports-massager.png b/src/content/images/apps/sports-massager.png deleted file mode 100644 index 683079a..0000000 Binary files a/src/content/images/apps/sports-massager.png and /dev/null differ diff --git a/src/content/images/page-button-next.png b/src/content/images/page-button-next.png new file mode 100644 index 0000000..6508056 Binary files /dev/null and b/src/content/images/page-button-next.png differ diff --git a/src/content/images/page-button-prev.png b/src/content/images/page-button-prev.png new file mode 100644 index 0000000..a2de2e9 Binary files /dev/null and b/src/content/images/page-button-prev.png differ diff --git a/src/content/images/paging-arrow-left.png b/src/content/images/paging-arrow-left.png deleted file mode 100644 index 2e23524..0000000 Binary files a/src/content/images/paging-arrow-left.png and /dev/null differ diff --git a/src/content/images/paging-arrow-right.png b/src/content/images/paging-arrow-right.png deleted file mode 100644 index 1b585b3..0000000 Binary files a/src/content/images/paging-arrow-right.png and /dev/null differ diff --git a/src/content/images/separator.png b/src/content/images/separator.png deleted file mode 100644 index fb56d55..0000000 Binary files a/src/content/images/separator.png and /dev/null differ diff --git a/src/content/images/showcase-bg.png b/src/content/images/showcase-bg.png deleted file mode 100644 index 0c0a40a..0000000 Binary files a/src/content/images/showcase-bg.png and /dev/null differ diff --git a/src/content/images/showcase-tab-bg.png b/src/content/images/showcase-tab-bg.png deleted file mode 100644 index 415eb23..0000000 Binary files a/src/content/images/showcase-tab-bg.png and /dev/null differ diff --git a/src/content/index.rhtml b/src/content/index.rhtml index ccdfc27..02914f8 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,53 +1,57 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> We're a UK software house specialising in apps for iPhone, iPad and iPod Touch. Here's some of the stuff we've done. </p> </div> <div id="showcase"> + <div id="prev" class="page-control"><a href="#"><img src="/images/page-button-prev.png"></a></div> <div id="apps"> <% for app in @item[:apps]%> - <div class="app <%= app[:class] %>" id="<%= app[:name].downcase.gsub(' ','-') %>"> - <a href="<%= app[:itunes_url] %>"><img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"></a> + <div class="app <%= app[:class] %>" id="<%= app[:slug] %>"> + <a href="<%= app[:itunes_url] %>"> + <img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"> + </a> <div class="description"> <h2> <a href="<%= app[:itunes_url] %>"><%= app[:name] %></a> - <span class="appslogan"<%if app[:slogan_colour]%> style="color:<%=app[:slogan_colour]%>"<%end%>><%= app[:slogan]%></span> + <span class="appslogan"><%= app[:slogan]%></span> </h2> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" alt="App Store Badge Clipped" border="0"></a> </div> <% end %> </div> <div style="clear:right"> </div> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"></div> </div> <% end %> </div><!-- #apps --> + <div id="next" class="page-control"><a href="#"><img src="/images/page-button-next.png"></a></div> </div><!-- #showcase --> diff --git a/src/content/index.yaml b/src/content/index.yaml index 76dd957..f6d23d7 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,114 +1,83 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: "Oxford University: The Official Guide" + slug: oxford slogan: Discover the wonders of Oxford slogan_colour: "#479d26" itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 image: /images/apps/oxford-university.png description: - > Oxford University's first official iPhone app takes you on a guided tour of this beautiful city and its world-famous university. - - > Discover Oxford through the eyes of those who know it best, + - > Discover Oxford through the eyes of those who know it best, including Harry Potter! client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> platform: iPhone and iPod Touch - name: iBreastCheck + slug: ibreastcheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice + slug: luckyvoice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs client: Lucky Voice Ltd platform: iPad class: ipad - - - name: BBC Bitesize Exam Alert - slogan: Track your exams the fun way - slogan_colour: "#39f" - itunes_url: http://itunes.apple.com/gb/app/gcse-bitesize-exam-alert/id414023535?mt=8 - image: /images/apps/bbc-bitesize.png - description: - - > Our popular Exam Countdown app, re-branded - for the BBC Bitesize iPhone app series. - - > Track your forthcoming exams, get study tips - and share with your friends via Facebook - client: BBC Bitesize / Pearson Education Ltd - platform: iPhone and iPod Touch - + - name: The xx + slug: xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: Beggars Group Ltd platform: iPhone and iPod Touch - name: RSA Vision + slug: rsavision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android" - - name: Exam Countdown - slogan: Track your exams the fun way - slogan_colour: "#888" - itunes_url: http://itunes.apple.com/gb/app/exam-countdown/id372962356?mt=8 - image: /images/apps/exam-countdown.png - description: - - > The Exam Countdown app allows students to keep track of - forthcoming exams and share their thoughts via Facebook. - client: Pearson Education Ltd - platform: iPhone and iPod Touch - - - name: Sports Massager - itunes_url: http://itunes.apple.com/gb/app/sports-massager/id352993865?mt=8 - slogan: Let your phone take the strain - slogan_colour: "#3956BD" - image: /images/apps/sports-massager.png - description: - - > Aching after a great workout? Let Dan The Man take the strain! - Just hit the button then enjoy a relaxing massage from Dan The - Man in this fun app - Goo's first foray onto the App Store. - platform: iPhone - - diff --git a/src/content/js/showcase.js b/src/content/js/showcase.js index e9f5ce5..3c216a6 100644 --- a/src/content/js/showcase.js +++ b/src/content/js/showcase.js @@ -1,53 +1,105 @@ function get_current_page() { return Math.round($('#apps').scrollLeft() / $('#apps').width()); } function scroll_to_page(page, animate) { var page_width = $('#apps').width(); var prev_page = get_current_page() var attr = {'scrollLeft': page_width * page}; // Do the scrolling if (animate) { - $('#apps').animate(attr, 300); + $('#apps').animate(attr, 300, function(){ + // animation complete + update_paging_controls(); + }); } else { $('#apps').attr(attr); + update_paging_controls(); } $('.pager').each(function(index){ $(this).toggleClass('selected', index == page); }); } -$(function () { +function update_paging_controls() { + var current_page = get_current_page(); + var last_page = $('.app').length - 1; + var OPACITY_FADED = 0.3; + var OPACITY_STD = 1.0; + + var target_opacity_prev = current_page == 0 ? OPACITY_FADED : OPACITY_STD; + var target_opacity_next = current_page == last_page ? OPACITY_FADED : OPACITY_STD; + + if (Math.abs($('.page-control#prev img').css('opacity') - target_opacity_prev) > 0.5) { + $('.page-control#prev img').animate({'opacity': target_opacity_prev}, 150); + } + if (Math.abs($('.page-control#next img').css('opacity') - target_opacity_next) > 0.5) { + $('.page-control#next img').animate({'opacity': target_opacity_next}, 150); + } + + if (current_page > 0) { + prev_app_id = $('.app').get(current_page - 1).id; + $('.page-control#prev a').attr('href', '#!' + prev_app_id); + } else { + $('.page-control#prev a').attr('href', ''); + } + + if (current_page < last_page) { + next_app_id = $('.app').get(current_page + 1).id; + $('.page-control#next a').attr('href', '#!' + next_app_id); + } else { + $('.page-control#next a').attr('href', ''); + } +} + +function prev_page() { + var current_page = get_current_page(); + + if (current_page == 0) + return + scroll_to_page(current_page - 1, true); +} + +function next_page() { + var current_page = get_current_page(); + var last_page = $('.app').length - 1; + + if (current_page == last_page) + return + scroll_to_page(current_page + 1, true); +} + +$(document).ready(function () { var w = $('#apps').width(); // don't run on the iPhone if (w > 480) { - var page_control = $('<div></div>').attr('id','page_control'); + // First, layout the apps var PADDING = 30; $('.app').each(function(index) { $(this).css({ 'position': 'absolute', 'top': 0, 'left': (w * index) + 'px', 'width': (w - PADDING * 2) + 'px', 'padding': PADDING + 'px', }); - var pager = $('<a></a>').attr('class','pager'); - pager.attr('href','#!' + $(this).attr('id')).html($('h2 a', $(this)).html()); - pager.click(function(){ scroll_to_page(index, true); }); - page_control.append(pager); }); $('#apps').css('overflow','hidden'); - $('#showcase').prepend(page_control); + + // Now make the page-control buttons visible + $('.page-control#next').click(function(){ next_page(); }); + $('.page-control#prev').click(function(el){ prev_page(); }); + $('.page-control').show(); } if (r = location.href.match('#!(.+)')) { var app = $('#' + r[1]); var index = $('.app').index(app); if (index >= 0) scroll_to_page(index, false); else scroll_to_page(0); } else { scroll_to_page(0); } });
simonwhitaker/goo-website
9e04ee3ca84980a888a57c4fca3ae8657375c175
Added Oxford University app
diff --git a/src/content/images/apps/oxford-university.png b/src/content/images/apps/oxford-university.png new file mode 100644 index 0000000..4588bca Binary files /dev/null and b/src/content/images/apps/oxford-university.png differ diff --git a/src/content/index.yaml b/src/content/index.yaml index 9451acd..76dd957 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,100 +1,114 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: + - name: "Oxford University: The Official Guide" + slogan: Discover the wonders of Oxford + slogan_colour: "#479d26" + itunes_url: http://itunes.apple.com/gb/app/oxford-university-the-official/id453006222?mt=8 + image: /images/apps/oxford-university.png + description: + - > Oxford University's first official iPhone app takes you on + a guided tour of this beautiful city and its world-famous + university. + - > Discover Oxford through the eyes of those who know it best, + including Harry Potter! + client: <a href="http://www.ox.ac.uk/">The University of Oxford</a> + platform: iPhone and iPod Touch + - name: iBreastCheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Lucky Voice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs client: Lucky Voice Ltd platform: iPad class: ipad - name: BBC Bitesize Exam Alert slogan: Track your exams the fun way slogan_colour: "#39f" itunes_url: http://itunes.apple.com/gb/app/gcse-bitesize-exam-alert/id414023535?mt=8 image: /images/apps/bbc-bitesize.png description: - > Our popular Exam Countdown app, re-branded for the BBC Bitesize iPhone app series. - > Track your forthcoming exams, get study tips and share with your friends via Facebook client: BBC Bitesize / Pearson Education Ltd platform: iPhone and iPod Touch - name: The xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: Beggars Group Ltd platform: iPhone and iPod Touch - name: RSA Vision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android" - name: Exam Countdown slogan: Track your exams the fun way slogan_colour: "#888" itunes_url: http://itunes.apple.com/gb/app/exam-countdown/id372962356?mt=8 image: /images/apps/exam-countdown.png description: - > The Exam Countdown app allows students to keep track of forthcoming exams and share their thoughts via Facebook. client: Pearson Education Ltd platform: iPhone and iPod Touch - name: Sports Massager itunes_url: http://itunes.apple.com/gb/app/sports-massager/id352993865?mt=8 slogan: Let your phone take the strain slogan_colour: "#3956BD" image: /images/apps/sports-massager.png description: - > Aching after a great workout? Let Dan The Man take the strain! Just hit the button then enjoy a relaxing massage from Dan The Man in this fun app - Goo's first foray onto the App Store. platform: iPhone
simonwhitaker/goo-website
9f49cf648312a7e6d973e07a233ee07b341b0cd4
Adding installation instuctions
diff --git a/README.markdown b/README.markdown index d2a8cfd..b3ac914 100644 --- a/README.markdown +++ b/README.markdown @@ -1,25 +1,28 @@ This is the code base for the Goo Software Ltd website ([www.goosoftware.co.uk](http://www.goosoftware.co.uk)). It uses [Nanoc](http://nanoc.stoneship.org/) to build the static site contents - check it out, it's really cool. # Installation gem install nanoc gem install rack gem install mime-types gem install kramdown gem install builder + gem install rake + gem install bundler + # Compiling the site To compile once: nanoc co To test (runs a WEBBrick server and re-compiles every time a file changes): nanoc aco # Deployment rake deploy \ No newline at end of file
simonwhitaker/goo-website
d47c5cd7336fcd76c95b2eba1762d361c28dfae2
Fix CSS for iPhone-optimised site
diff --git a/src/content/css/goo.css b/src/content/css/goo.css index 950f87c..39bee99 100644 --- a/src/content/css/goo.css +++ b/src/content/css/goo.css @@ -1,422 +1,423 @@ @import url('base.css'); body { width: 840px; } #main { padding: 0; margin: 20px 0 30px 0; background-color: white; position: relative; -moz-box-shadow: 0 4px 8px #333; -webkit-box-shadow: 0 4px 8px #333; box-shadow: 0 4px 8px #333; } /* Header ----------------------------------------*/ #header { position: relative; height: 180px; } #logo { position: absolute; left: 40px; top: 40px; } #slogan { position: absolute; font-size: 17px; left: 130px; top: 140px; font-family: "Century Gothic", "Helevica Neue", Arial, Helvetica, sans-serif; color: #09f; } /* Navigation tabs ----------------------------------------*/ #nav { position: absolute; right: 0px; top: 40px; } #nav .tabs { margin: 0; text-align: right; } #nav .tabs li { margin-bottom: 12px; } #nav .tabs li a { text-decoration: none; background-color: #A0B400; color: white; padding: 5px 10px; } #nav .tabs li a:hover { text-decoration: none; background-color: #3C4200; color: white; padding: 5px 10px; } #nav .tabs li a.selected { background-color: #08d; } /* App showcase ----------------------------------------*/ #showcase { margin: 0; background-color: black; background-image: url('../images/app-bg.png'); background-repeat: no-repeat; color: #ddd; position: relative; width: 100%; } #apps { border-left: 1px solid #666; position: relative; margin: 0; width: 689px; height: 500px; } #showcase .detail { color: #aaa; font-size: 13px; } #showcase a { color: #fff; } .app-end { clear: left; } #showcase .app { padding: 30px; } #showcase .app h2 { margin-top: 0; font-size: 22px; font-weight: bold; } #showcase .app h2 a { text-decoration: none; color: #eee; } #showcase .app h2 a:hover { text-decoration: underline; } #showcase .app h2 .appslogan { color: #09f; font-weight: normal; margin-left: 6px; } #showcase .app .screenshot { float: left; max-width: 200px; } #showcase .app.ipad .screenshot { float: left; max-width: 320px; } #showcase .app .description { margin-left: 220px; padding: 0 15px; } #showcase .app.ipad .description { margin-left: 340px; padding: 0 15px; } #showcase .app .quotation { font-style: italic; } #showcase .app .quotation .source { font-style: normal; font-weight: normal; color: #666; margin-left: 5px; } #showcase .app .install-links { margin: 0 0 10px 0; } #showcase .app .appstore-badge { padding: 0; } #showcase .app div.android-info { float: right; width: 220px; font-size: 12px; } #showcase #page_control { position: relative; float: left; height: 100%; width: 150px; top: 40px; left: 0; height: 100%; } #showcase #page_control a { display: block; font-size: 15px; color: white; padding: 10px 10px; text-align: left; text-decoration: none; border-top: 1px solid #666; border-bottom: 1px solid #666; } #showcase #page_control a.selected { background-color: black; } #showcase #page_control a+a { border-top-width: 0; } #showcase #page_control a:hover { background-color: #09f; color: white; } /* Contact page ----------------------------------------*/ #contact-details { margin: 24px 0 12px 40px; } #contact-details td { min-width: 30px; padding: 0 0 10px 0; vertical-align: top; } #map { border: 1px solid #ccc; padding: 4px; float: right; } #end-map { clear: right; } /* Support page ----------------------------------------*/ .support-steps img { margin: 10px 0 30px 10px; border: 1px solid #ccc; padding: 3px; } .support-steps li+li { margin-top: 6px; } div.support-item { border-top: 1px solid #A0B400; padding-top: 10px; margin-top: 40px; } /* About page ----------------------------------------*/ .portrait { float: left; width: 162px; } .biog { margin-left: 180px; } /* Blog index ----------------------------------------*/ ul.blog-items { padding-left: 0; } .blog-items li { list-style-type: none; line-height: 1.7em; } .blog-items li .date { color: #999; font-size: 12px; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-color: #fff; background-image: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 20px; } #slogan { left: 120px; width: 340px; top: 120px; } #nav { position: relative; top: 0; left: 0; padding: 0; margin: 10px 0; } #nav .tabs { text-align: left; padding: 0; margin: 0 20px; } #nav .tabs li { float: left; font-size: 20px; } #nav .tabs li+li { margin-left: 1px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } #showcase { width: 440px; background-color: black; border-radius: 0; -moz-border-radius: 0; padding: 0 20px; margin: 20px 0 0 0; } #showcase #apps { width: 100%; border-width: 0; height: auto; } #showcase .app h2 a { } #showcase .app+.app { border-top: 1px solid #333; } #showcase .app { margin: 0; padding: 30px 0px; } #showcase .app img.screenshot { width: 120px; } + #showcase .app.ipad .description, #showcase .app .description { margin-left: 140px; padding: 0px; } #footer { margin: 0; padding: 20px 10px; text-align: center; font-size: 10px; } #footer a { } .portrait { float: left; width: 60px; } .biog { margin-left: 80px; } } \ No newline at end of file
simonwhitaker/goo-website
46e85c9a8255c6c6fb0e857445a37e7fd278a1bc
Adding installation instuctions
diff --git a/README.markdown b/README.markdown index c8e7bab..d2a8cfd 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,25 @@ This is the code base for the Goo Software Ltd website ([www.goosoftware.co.uk](http://www.goosoftware.co.uk)). -It uses [Nanoc](http://nanoc.stoneship.org/) to build the static site contents - check it out, it's really cool. \ No newline at end of file +It uses [Nanoc](http://nanoc.stoneship.org/) to build the static site contents - check it out, it's really cool. + +# Installation + + gem install nanoc + gem install rack + gem install mime-types + gem install kramdown + gem install builder + +# Compiling the site + +To compile once: + + nanoc co + +To test (runs a WEBBrick server and re-compiles every time a file changes): + + nanoc aco + +# Deployment + + rake deploy \ No newline at end of file
simonwhitaker/goo-website
9f9f0436e69fbaba9c2ef4d25bfe107a87bdfca1
Move iBreastCheck to top of the tree, add note about NMA Award win
diff --git a/src/content/index.yaml b/src/content/index.yaml index 2bce255..9451acd 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,99 +1,100 @@ title: "Fantastic Apps for iPhone, iPad and iPod Touch" description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: + - name: iBreastCheck + slogan: Helping you to be breast aware + slogan_colour: "#C70064" + itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 + image: /images/apps/ibreastcheck.png + description: + - > <b>Winner, Charity and Voluntary Sector</b><br/>NMA Awards 2011 + - > iBreastCheck from breast cancer charity Breakthrough helps + you to be breast aware with a little TLC: Touch, Look, Check. + - > The app has video and slideshow content explaining how to + check your breasts, a reminder service to help you to remember + to check regularly, and more. + client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> + platform: iPhone and iPod Touch + - name: Lucky Voice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs client: Lucky Voice Ltd platform: iPad class: ipad - name: BBC Bitesize Exam Alert slogan: Track your exams the fun way slogan_colour: "#39f" itunes_url: http://itunes.apple.com/gb/app/gcse-bitesize-exam-alert/id414023535?mt=8 image: /images/apps/bbc-bitesize.png description: - > Our popular Exam Countdown app, re-branded for the BBC Bitesize iPhone app series. - > Track your forthcoming exams, get study tips and share with your friends via Facebook client: BBC Bitesize / Pearson Education Ltd platform: iPhone and iPod Touch - name: The xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: Beggars Group Ltd platform: iPhone and iPod Touch - name: RSA Vision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android" - - name: iBreastCheck - slogan: Helping you to be breast aware - slogan_colour: "#C70064" - itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 - image: /images/apps/ibreastcheck.png - description: - - > iBreastCheck from breast cancer charity Breakthrough helps - you to be breast aware with a little TLC: Touch, Look, Check. - - > The app has video and slideshow content explaining how to - check your breasts, a reminder service to help you to remember - to check regularly, and more. - client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> - platform: iPhone and iPod Touch - - name: Exam Countdown slogan: Track your exams the fun way slogan_colour: "#888" itunes_url: http://itunes.apple.com/gb/app/exam-countdown/id372962356?mt=8 image: /images/apps/exam-countdown.png description: - > The Exam Countdown app allows students to keep track of forthcoming exams and share their thoughts via Facebook. client: Pearson Education Ltd platform: iPhone and iPod Touch - name: Sports Massager itunes_url: http://itunes.apple.com/gb/app/sports-massager/id352993865?mt=8 slogan: Let your phone take the strain slogan_colour: "#3956BD" image: /images/apps/sports-massager.png description: - > Aching after a great workout? Let Dan The Man take the strain! Just hit the button then enjoy a relaxing massage from Dan The Man in this fun app - Goo's first foray onto the App Store. platform: iPhone
simonwhitaker/goo-website
1da8259eae6d0c0cd7b68fd821eb06381938be77
Remove references to Android
diff --git a/src/content/contact.rhtml b/src/content/contact.rhtml index 92c9afc..f90b8f8 100644 --- a/src/content/contact.rhtml +++ b/src/content/contact.rhtml @@ -1,50 +1,50 @@ <div id="content"> <h1> Contact Goo </h1> <p> - Need an iPhone, iPad or Android app? Think you might need one, but not sure? Want to know what all the fuss is about? Get in touch and we'll be happy to chat! + Need an iPhone, iPad or iPod Touch app? Think you might need one, but not sure? Want to know what all the fuss is about? Get in touch and we'll be happy to chat! </p> <div id="map"> <a href="http://maps.google.co.uk/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=OX15+4FF&amp;sll=51.752276,-1.255824&amp;sspn=0.153665,0.277405&amp;ie=UTF8&amp;hq=&amp;hnear=Banbury,+Oxfordshire+OX15+4FF,+United+Kingdom&amp;z=15"><img src="/images/gmap.png" width="320" height="240" alt="Map"></a> </div> <table border="0" id="contact-details"> <tbody> <tr> <td> <a href="http://maps.google.co.uk/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=OX15+4FF&amp;sll=51.752276,-1.255824&amp;sspn=0.153665,0.277405&amp;ie=UTF8&amp;hq=&amp;hnear=Banbury,+Oxfordshire+OX15+4FF,+United+Kingdom&amp;z=15"><img src="/images/pin.png" width="16" height="16" alt="Location" class="icon" border="0"></a> </td> <td> Goo Software Ltd<br> Bloxham Mill<br> Barford Road<br> Bloxham<br> OX15 4FF </td> </tr> <tr> <td></td> <td> +44 1295 724117 </td> </tr> <tr> <td> <a href="mailto:info@goosoftware.co.uk"><img src="/images/email.png" width="16" height="16" alt="Email" class="icon" border="0"></a> </td> <td> <a href="mailto:info@goosoftware.co.uk">info@goosoftware.co.uk</a> </td> </tr> <tr> <td> <a href="http://twitter.com/goosoftware"><img src="/images/twitter.png" width="16" height="16" alt="Twitter" class="icon" border="0"></a> </td> <td> <a href="http://twitter.com/goosoftware">@goosoftware</a> </td> </tr> </tbody> </table> <div id="end-map"></div> </div> \ No newline at end of file diff --git a/src/content/index.rhtml b/src/content/index.rhtml index 8a9416d..ccdfc27 100644 --- a/src/content/index.rhtml +++ b/src/content/index.rhtml @@ -1,53 +1,53 @@ <div id="content"> <h1> Welcome to Goo! </h1> <p> - We're a UK software house specialising in apps for iPhone, iPad and Android. Here's some of the stuff we've done. + We're a UK software house specialising in apps for iPhone, iPad and iPod Touch. Here's some of the stuff we've done. </p> </div> <div id="showcase"> <div id="apps"> <% for app in @item[:apps]%> <div class="app <%= app[:class] %>" id="<%= app[:name].downcase.gsub(' ','-') %>"> <a href="<%= app[:itunes_url] %>"><img src="<%= app[:image] %>" class="screenshot" alt="app screenshot" border="0"></a> <div class="description"> <h2> <a href="<%= app[:itunes_url] %>"><%= app[:name] %></a> <span class="appslogan"<%if app[:slogan_colour]%> style="color:<%=app[:slogan_colour]%>"<%end%>><%= app[:slogan]%></span> </h2> <% for desc in app[:description]%> <p><%= desc %></p> <% end %> <div class="install-links"> <% if app[:android_package] %> <div class="android-info"> To install on Android, search the marketplace for <%= app[:name] %> or scan <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=400x400&amp;chld=Q%7C3&amp;chl=market://details?id=<%= app[:android_package] %>">this QR code</a> </div> <% end %> <% if app[:itunes_url] %> <div class="appstore-badge"> <a href="<%= app[:itunes_url] %>"><img src="/images/app-store-badge-clipped.png" alt="App Store Badge Clipped" border="0"></a> </div> <% end %> </div> <div style="clear:right"> </div> <% if app[:client] %> <div class="detail">Client: <%= app[:client] %></div> <% end %> <% if app[:platform] %> <div class="detail">Platform: <%= app[:platform] %></div> <% end %> </div> <div class="app-end"></div> </div> <% end %> </div><!-- #apps --> </div><!-- #showcase --> diff --git a/src/content/index.yaml b/src/content/index.yaml index 4e7c0e0..2bce255 100644 --- a/src/content/index.yaml +++ b/src/content/index.yaml @@ -1,99 +1,99 @@ -title: "Fantastic Apps for iPhone, iPad and Android" -description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and Android." +title: "Fantastic Apps for iPhone, iPad and iPod Touch" +description: "Goo Software Ltd is an independent UK-based software house specialising in development of apps for iPhone, iPad and iPod Touch." js_imports: - showcase.js apps: - name: Lucky Voice slogan: Sing your heart out! slogan_colour: "#FE01B4" itunes_url: http://itunes.apple.com/gb/app/lucky-voice-karaoke/id428963272?mt=8 image: /images/apps/lucky-voice.png description: - > The ultimate karaoke experience for your iPad! - > Sing along to over 7,500 songs client: Lucky Voice Ltd platform: iPad class: ipad - name: BBC Bitesize Exam Alert slogan: Track your exams the fun way slogan_colour: "#39f" itunes_url: http://itunes.apple.com/gb/app/gcse-bitesize-exam-alert/id414023535?mt=8 image: /images/apps/bbc-bitesize.png description: - > Our popular Exam Countdown app, re-branded for the BBC Bitesize iPhone app series. - > Track your forthcoming exams, get study tips and share with your friends via Facebook client: BBC Bitesize / Pearson Education Ltd platform: iPhone and iPod Touch - name: The xx slogan: Innovative video experience slogan_colour: "#4e6072" itunes_url: http://itunes.apple.com/gb/app/the-xx/id394653020?mt=8 image: /images/apps/the-xx.png description: - > Using this fun and unique app, you and up to two friends can play tracks from the xx's award-winning debut album <em>XX</em> across multiple iPhones or iPod Touches. - > <span class="quotation"> &quot;An ingenious use of technology&quot; <span class="source"> &mdash; The Guardian</span> </span> client: Beggars Group Ltd platform: iPhone and iPod Touch - name: RSA Vision slogan: Enlightenment to go slogan_colour: "#CE5B02" itunes_url: http://itunes.apple.com/gb/app/rsa-vision/id397348011?mt=8 android_package: com.goocode.rsavision image: /images/apps/rsa-vision.png description: - > The RSA Vision app brings to you the latest videos from the RSA's free public events programme. You can browse by category, search for videos and compile a playlist of your favourite videos to watch later. - (Check out the RSAnimate category - they're <em>really</em> great!) client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: "iPhone, iPod Touch, Android" - name: iBreastCheck slogan: Helping you to be breast aware slogan_colour: "#C70064" itunes_url: http://itunes.apple.com/gb/app/ibreastcheck/id391746205?mt=8 image: /images/apps/ibreastcheck.png description: - > iBreastCheck from breast cancer charity Breakthrough helps you to be breast aware with a little TLC: Touch, Look, Check. - > The app has video and slideshow content explaining how to check your breasts, a reminder service to help you to remember to check regularly, and more. client: <a href="http://www.torchbox.com/">Torchbox Ltd</a> platform: iPhone and iPod Touch - name: Exam Countdown slogan: Track your exams the fun way slogan_colour: "#888" itunes_url: http://itunes.apple.com/gb/app/exam-countdown/id372962356?mt=8 image: /images/apps/exam-countdown.png description: - > The Exam Countdown app allows students to keep track of forthcoming exams and share their thoughts via Facebook. client: Pearson Education Ltd platform: iPhone and iPod Touch - name: Sports Massager itunes_url: http://itunes.apple.com/gb/app/sports-massager/id352993865?mt=8 slogan: Let your phone take the strain slogan_colour: "#3956BD" image: /images/apps/sports-massager.png description: - > Aching after a great workout? Let Dan The Man take the strain! Just hit the button then enjoy a relaxing massage from Dan The Man in this fun app - Goo's first foray onto the App Store. platform: iPhone diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index 5f4c052..f432550 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,108 +1,108 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> - Thoughts on developing fantastic apps for iPhone, iPad and Android + Thoughts on developing fantastic apps for iPhone, iPad and iPod Touch </div> </div> <!-- Sidebar --> <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> <% end %> <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> <% end %> <div class="blog-content"> <%= yield %> </div> <!-- Previous / next nav --> <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> </div> <% end %> <% if @item[:created_at] %> <div class="comments"> <h2>Comments</h2> <div id="disqus_thread"></div> <script type="text/javascript"> /** * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://goosoftware.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=goosoftware">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </div> <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html> diff --git a/src/layouts/goo.rhtml b/src/layouts/goo.rhtml index 9cd109c..bf38dd5 100644 --- a/src/layouts/goo.rhtml +++ b/src/layouts/goo.rhtml @@ -1,45 +1,45 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software - <%= @item[:title] %> </title> <link rel="stylesheet" href="/css/goo.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main"> <div id="header"> <a href="/"><img src="/images/goo-logo.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> - Fantastic apps for iPhone, iPad and Android + Fantastic apps for iPhone, iPad and iPod Touch </div> </div> <div id="nav"> <ul class="tabs"> <% for nl in navlinks %> <li> <a <% if @item.identifier == nl[:url] %>class="selected"<% end %> href="<%= nl[:url] %>"><%= nl[:text] %></a> </li> <% end %> </ul> </div> <%= yield %> <div id="footer"> Goo Software Ltd, registered in England and Wales with company number 7242280. Registered address: 88 Lucerne Avenue, Bicester OX26 3EL, UK </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
2c8ab4f31b64c96c07211348a401f738760960e3
Tweaking the blog CSS
diff --git a/src/content/css/blog.css b/src/content/css/blog.css index afaf79b..e89e884 100644 --- a/src/content/css/blog.css +++ b/src/content/css/blog.css @@ -1,239 +1,251 @@ @import url('base.css'); body { background-color: #000; max-width: 1200px; } #header { border-bottom: 1px solid #444; } #content { background-color: #000; margin-right: 220px; color: #999; } #slogan { color: #666; } /* Code ----------------------------------------*/ pre, code { font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 14px; color: #fff; } pre { margin: 30px; padding: 12px; background-color: #333; border-radius: 12px; } /* Monochrome nav */ #nav { top: 20px; } #nav .tabs li a { background-color: #aaa; color: white; } #nav .tabs li a:hover { background-color: #555; color: white; } #nav .tabs li a.selected { background-color: #08d; } /* Blog article navigation */ .blog-nav { margin: 12px 0; font-size: 13px; } .blog-nav .nav { padding: 0; margin: 0; } .blog-nav .nav+.nav { border-left: 1px dotted #444; padding-left: 10px; margin-left: 10px; } /* Misc blog formatting */ h1 { color: #09f; font-size: 33px; line-height: 1.1em; } +h2 { + color: #fff; + font-size: 28px; + font-weight: normal; +} + +h3 { + color: #fff; + font-size: 20px; + font-weight: normal; +} + .meta { color: #666; font-style: italic; } blockquote { margin: 30px; padding: 20px 20px 20px 70px; background-color: #333; border-radius: 12px; color: #ccc; background-image: url(../images/open-quote.png); background-repeat: no-repeat; } a[href] { color: #08d; } /* Comments */ .comments { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #777; } /* Latest posts */ #sidebar { float: right; width: 200px; padding: 20px 10px; margin: 0; font-size: 13px; } #sidebar a { color: #bbb; } #sidebar a:hover { color: #09f; } #sidebar .subscribe a { background-image: url("/images/feed-icon-14x14.png"); background-position: right 0; background-repeat: no-repeat; padding-right: 17px; } #sidebar h2 { color: #999; font-size: 20px; text-transform: uppercase; padding: 0; } #sidebar ul { margin: 0; padding: 0; } #sidebar li { display: block; padding: 0; } #sidebar li a { display: block; padding: 5px 0; } #sidebar li a.selected { font-weight: bold; } img.framed { border-color: #666; } #footer { clear: both; } @media screen and (max-device-width: 480px) { body { width: 480px; margin: 0; padding: 0; background-image: none; } code { display: block; max-width: 480px; overflow: hidden; } img { max-width: 400px; margin: 6px 0; padding: 0; } img.framed { border-width: 0; padding: 0; margin: 6px 0; } #sidebar { display: none; } p, div, span, li { font-size: 20px; } h1 { font-size: 28px; font-weight: normal; } h2 { font-size: 24px; } h3 { font-size: 20px; } #header { height: 160px; border-width: 0; } #main { margin: 0; padding: 0; background-image: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } #logo { left: 10px; top: 10px; } #content { clear: both; padding: 0 20px; margin: 60px 0 0 0; width: 440px; } } \ No newline at end of file
simonwhitaker/goo-website
770cfd2d80aa2c35de3e626858194c7af6e4f25b
Use blog CSS on blog index
diff --git a/src/Rules b/src/Rules index f59a169..ba43c40 100644 --- a/src/Rules +++ b/src/Rules @@ -1,61 +1,66 @@ #!/usr/bin/env ruby # A few helpful tips about the Rules file: # # * The order of rules is important: for each item, only the first matching # rule is applied. # # * Item identifiers start and end with a slash (e.g. “/about/” for the file # “content/about.html”). To select all children, grandchildren, … of an # item, use the pattern “/about/*/”; “/about/*” will also select the parent, # because “*” matches zero or more characters. compile '/blog/feed/' do filter :erb end +compile '/blog/' do + filter :erb + layout 'blog' +end + compile '*' do do_layout = false if item[:extension] =~ /(md|markdown)/ filter :kramdown do_layout = true elsif item[:extension] =~ /r?html/ filter :erb do_layout = true end if do_layout then if item[:kind] == 'article' or item[:kind] == 'draft' layout 'blog' else layout 'goo' end end end route '/blog/feed/' do '/blog.xml' end route %r{^/(css|js|images)/.*/} do item.identifier.chop + '.' + item[:extension] end route '/error/*/' do item.identifier.chop + '.html' end route '/htaccess/' do '/.htaccess' end route '/blog/*/' do '/blog/' + item[:title].to_slug + '/index.html' end route '*' do item.identifier + 'index.html' end layout '*', :erb diff --git a/src/content/blog.rhtml b/src/content/blog.rhtml index 504128b..1186e97 100644 --- a/src/content/blog.rhtml +++ b/src/content/blog.rhtml @@ -1,13 +1,16 @@ --- -title: Blog Index +title: Latest blog articles --- <div id="content"> - <h1>Latest blog articles</h1> + <!-- <h1>Latest blog articles</h1> --> <ul class="blog-items"> <% for article in sorted_articles %> - <li><span class="date"><%= article[:created_at]%></span> <a href="<%= article.path %>"><%= article[:title] %></a></li> + <li> + <span class="date"><%= article[:created_at]%></span> + <a href="<%= article.path %>"><%= article[:title] %></a> + </li> <% end %> </ul> </div> diff --git a/src/layouts/blog.rhtml b/src/layouts/blog.rhtml index 6811319..5f4c052 100644 --- a/src/layouts/blog.rhtml +++ b/src/layouts/blog.rhtml @@ -1,94 +1,108 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <% if @item[:description] %> <meta name="description" content="<%= @item[:description] %>"> <% end %> <title> Goo Software Blog - <%= @item[:title] %> </title> <link rel="alternate" type="application/atom+xml" title="Goo Software Blog" href="/blog.xml" /> <link rel="stylesheet" href="/css/blog.css" type="text/css" media="screen" charset="utf-8"> <script type="text/javascript" charset="utf-8" src="/js/google-analytics.js"></script> <script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script> <% if @item[:js_imports] %> <% for js in @item[:js_imports] %> <script type="text/javascript" charset="utf-8" src="js/<%= js %>"></script> <% end %> <% end %> </head> <body> <div id="main" class="blog"> <div id="header"> <a href="/"><img src="/images/goo-logo-333.png" id="logo" width="200" height="118" alt="Goo Logo" border="0" name="logo"></a> <div id="slogan"> Thoughts on developing fantastic apps for iPhone, iPad and Android </div> </div> + + <!-- Sidebar --> + <% if @item[:created_at] %> <div id="sidebar"> <div class="subscribe"> <a href="/blog.xml">Subscribe</a> </div> <div> <h2>Goo Software</h2> <ul> <li><a href="/">Goo home</a></li> <li><a href="/blog/">Blog index</a></li> </ul> </div> <div id="latest-posts"> <h2>Latest posts</h2> <ul> <% for a in sorted_articles[0,5] %> <li><a href="<%= a.path %>" <%if @item.identifier == a.identifier%>class="selected"<%end%>><%= a[:title] %></a></li> <% end %> </ul> </div> </div> + <% end %> + + <!-- Main bit --> <div id="content"> <h1><%= @item[:title] %></h1> + <% if @item[:created_at] %> <div class="meta"> Posted <%= @item[:created_at] %> by <%= @item[:author_name] or @config[:author_name] %> </div> + <% end %> <div class="blog-content"> <%= yield %> </div> + + <!-- Previous / next nav --> + <% if @item[:created_at] %> <div class="blog-nav"> <% index = sorted_articles.index(@item).to_i %> <% if @item != sorted_articles.last then %> <span class="nav previous"> &larr; <a href="<%= sorted_articles[index + 1].path %>"><%= sorted_articles[index + 1][:title]%></a> </span> <% end %> <% if @item != sorted_articles.first then %> <span class="nav next"> <a href="<%= sorted_articles[index-1].path %>"><%= sorted_articles[index-1][:title]%></a> &rarr; </span> <% end %> - </div> + <% end %> + + <% if @item[:created_at] %> <div class="comments"> <h2>Comments</h2> <div id="disqus_thread"></div> <script type="text/javascript"> /** * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread] */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://goosoftware.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=goosoftware">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </div> + <% end %> </div><!-- #content --> <div style="clear:both"> </div> </div><!-- #main --> </body> </html>
simonwhitaker/goo-website
0c06c864a5eed32300b8e52957a1bcd691a8bf09
Added update about Instruments interference
diff --git a/src/content/blog/0009-Xcode4-symbolication-problems.md b/src/content/blog/0009-Xcode4-symbolication-problems.md index 2117546..1a6b174 100644 --- a/src/content/blog/0009-Xcode4-symbolication-problems.md +++ b/src/content/blog/0009-Xcode4-symbolication-problems.md @@ -1,51 +1,55 @@ --- kind: article created_at: 2011-03-30 title: The symbolicator helps those who help themselves --- It sounds like [I'm not the only one][so1] having problems with Xcode 4 not symbolicating crash logs correctly. Here's the symptom: I drag crash logs that testers email me into Xcode 4's organiser, then sit and wait for symbolication to complete. But once it's done, my logs aren't symbolicated - they still just show a load of memory locations. Running the symbolicator at the command line sheds a bit of light on what's going wrong: $ /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks\ > /DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash MyApp_etc.crash Here's the output I get: Can't understand the output from otool ( -> '\/Developer\/Platforms\/ iPhoneOS\.platform\/Developer\/usr\/bin\/otool -arch armv7 -l /Users/simon/Library/Developer/Xcode/DerivedData/MyApp-fbxifqioardhgxaitjdftgoejjzz/ Build/Products/Debug-iphonesimulator/MyApp.app/MyApp') at /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/ DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash line 323. Hmm... Notice that path to the app? **~/Library/Developer/Xcode/&#x200b;DerivedData/MyApp-fbxifqioardhgxaitjdftgoejjzz/&#x200b;Build/Products/Debug-iphonesimulator/&#x200b;MyApp.app/MyApp** That's not the right app file - it's the build output from a Debug build, not an AdHoc build, and worse it's a Debug build for the iOS simulator. As you may know, the symbolicator uses Spotlight to find the .app file (and the .dSYM file) it uses to symbolicate a log. And that means that there's a really simple fix. Adding **~/Library/Developer/Xcode/DerivedData/** to the list of directories that Spotlight doesn't index makes those build artefacts invisible to Spotlight, and hence the symbolicator. Just open System Preferences, click on Spotlight, switch to the Privacy tab and add that DerivedData folder to the list. You may now find that the symbolicator has a similar problem with apps installed on the iPhone simulator itself. Adding **~/Library/Application Support/iPhone Simulator/** to Spotlight's ignore list nails that one. <img title="Spotlight settings" src="/images/blog/spotlight-symbolicator.png" alt="" /> Now when I run the symbolicator at the command line, I get properly symbolicated output, just as expected. -[so1]: http://stackoverflow.com/questions/5458573/xcode-4-failure-to-symbolicate-crash-log/5491334#5491334 \ No newline at end of file +**UPDATE**: See the comments on [this Stack Overflow answer][so2] of mine. This solution +is not without its gotchas; it can interfere with correct running of the Instruments app. + +[so1]: http://stackoverflow.com/questions/5458573/xcode-4-failure-to-symbolicate-crash-log/5491334 +[so2]: http://stackoverflow.com/questions/5458573/xcode-4-failure-to-symbolicate-crash-log/5491334#5491334 \ No newline at end of file