Ricky Moorhouse

Blog

God is Faithful - Deu 7:9

Know therefore that the Lord your God is God, the faithful God who keeps covenant and steadfast love with those who love him and keep his commandments, to a thousand generations.

Deuteronomy 7:9, ESV

Since downloading the Fighter Verses iPhone app, I've started slowly to try to memorise the verses from scripture - Here's some of my notes on the first one.

In the verses leading up to this, God reminds his people that it is because of his promise to their ancestors that he has rescued them from Egypt and instructs them on how to deal with the nations around them, particularly cautioning them not to enter agreements or intermarry with the people he told tehm to destroy.

God has set apart his own people to be special to him, not because of any greatness or achievement of their own. Because of this evidence of God's love for them, carried out through the generations, they can be assured that God will continue keep his covenant.

God sets himself apart from the false gods of the surrounding nations.  He is the one true God who will loyally keep his covenent agreement. His love stands firm amidst the changing world, he is the only one that can be depended on, and they can see that from their history.  His people are called to be loyal to him, love him and keep the commandments - reflecting the way he loves us.

Banana & Chocolate chip muffins

Had a lovely afternoon making these Banana & Chocolate chip muffins with Abi and Jessica:

I'd used the last 2 eggs at lunchtime so when we decided to do some cooking I searched for recipes without eggs - turns out that the best thing to search for is eggless recipes. I then found the recipe for these muffins which after I made a couple of alterations to, we had all the ingredients for. We all had fun making them and they were delicious, although unfortunately I decided to only make half the quantities so we only had 6! The recipe with my alterations is below (makes 6)

Ingredients

  • 1 cup self raising flour

  • ¼ cup oats

  • ½ cup sugar

  • 6 squares of chocolate (chopped up)

  • 2 bananas (mashed)

  • ¼ cup sunflower oil

  • 2 tblsp water

Directions

  1. Pre-heat the oven to 190°C

  2. Mix the mashed banana, oil and sugar and water together to create a smooth paste.

  3. Mix in the flour, oats and chocolate pieces.

  4. Spoon carefully into muffin cases, about 3 tsp of mixture per case

  5. Cook for 20 minutes.

5 Minute Mug Brownie

A while back I saw that Pete had posted this on twitter, and we decided it was worth a try - since then I can't remember how many times we've made them as it's so simple and tastes good!  Just posting it on my blog so it's easier to find in the future!

Ingredients

  • 4 tablespoons flour

  • 4 tablespoons sugar

  • 2 tablespoons cocoa

  • 1 egg

  • 3 tablespoons milk

  • 3 tablespoons oil

  • A splash of vanilla extract (we didn't use this)

  • 3 tablespoons of chocolate chips (optional)

Directions

  1. Combine the dry ingredients in a large coffee mug

  2. Add the egg and mix together

  3. Pour in the milk and oil, mix

  4. Add the chocolate chips and vanilla extract (if using)

  5. Microwave for 3 minutes

  6. Allow to cool and tip onto a plate

(Originally from http://i.imgur.com/6edYs.png)

Getting more from your meetings

From the earliest days of the church, first with Jesus and his disciples, then with Paul and his protégés, and on down the line, the gospel moves forward because one generation of leaders cares enough about the next generation of leaders to invite them into the room.

Jamie Munson - Getting more from your meetings

Treasure Island

This afternoon we took the girls to the New Theatre Royal to watch Treasure Island, thanks to winning tickets in their twitter competition.

The set was really impressive with so many different things to spot with Abi before the show started, and had a fantastic ship's bridge, which doubled as the tavern entrance.

The show started with the beating of a drum and a fiddle player on stage, then the musicians took over and it developed into a big opening number, a combination which returned several times throughout, making great use of rhythmic elements intertwining with music from the excellent musicians.

There was a great balance of comedic and serious moments. The cast were fantastic and interacted well with the audience creating a great atmosphere.

The New Theatre Royal is a beautiful setting and all the staff were friendly and helpful. We had a really fun time and the girls both had a great time and got really into the show. If you can get to a performance, I'd strongly recommend it!

Recreating swipe to reveal in HTML, CSS and JS

One of the things I really like about the interface in Tweetie / Twitter for iPhone is being able to swipe a tweet to reveal actions beneath it.  This is my attempt to recreate it using HTML, CSS3 and Javascript.  The main swiping action seems to work nicely, but to complete it, I'd like to add a bit more bounciness, a sound effect on swipe (using ?) and have better handling of non-swipe actions.

The HTML used in the demo is very simple - just an unordered list. This currently uses jQuery because I already had it in the code I intend to use this with, but it's unnecessary for this part. The javascript adds the div containing the actions and event listeners for touch events. When your finger moves across the screen, if the vertical movement of the swipe is less than 10 pixels the default action is stopped to prevent the view-port moving sideways. If the horizontal movement is greater than 30 pixels, this indicates a swipe to the right, and the "swiped" class is added to the element. There may well be a better way to ensure normal scrolling and link clicking can take place, but this seems to work for now.

Javascript

<code class="language-javascript">
var swipeToReveal = {
init: function() {
document.addEventListener('touchstart', swipeToReveal.ontouchstart, false);
document.addEventListener('touchmove', swipeToReveal.ontouchmove, false);
$(document.body).append('<div id="revealedActions">'+swipeToReveal.actions+'</div>');
swipeToReveal.bgitems = $('#revealedActions');
swipeToReveal.bgitems.hide();
},
actions: 'Get some actions here',
startx: 0,
starty: 0,
target: null,
ontouchmove: function(e) {
var dx = e.touches[0].pageX - swipeToReveal.startx;
var dy = e.touches[0].pageY - swipeToReveal.starty;
if ((dy < 10) && (dy > -10)) {
e.preventDefault();
if (dx > 30) {
$(swipeToReveal.target).addClass('swiped');
}
}
},
ontouchstart: function(e) {
$('li').removeClass('swiped');
var target = e.target;
swipeToReveal.target = target;
swipeToReveal.bgitems.css({top:target.offsetTop,height: target.offsetHeight});
swipeToReveal.bgitems.show();
swipeToReveal.startx = e.touches[0].pageX;
swipeToReveal.starty = e.touches[0].pageY;
}
}

$(document).ready(function() {swipeToReveal.init();});
</code>

The main effect is produced in CSS using using -webkit-transform and -webkit-transition to slide the list item off the page when it has the class "swiped". Initially I did this by altering the left position of the element but the animation effect was very slow so I've moved to use a 3d translate to take advantage of the iPhone's hardware acceleration. To get the bounce effect I think I could replace the ease-in on the transition with a custom formula. The div that is added by the javascript is shifted into the background with a negative z-index.

CSS

<code class="language-css">
li {
/* positioning and colours removed */
z-index: 20;
-webkit-transform: translate3d(0,0,0) rotate(0deg);
-webkit-transition: -webkit-transform 200ms ease-in;
}
li.swiped {
-webkit-transform: translate3d(100%,0,0) rotate(0deg);
-webkit-transition: -webkit-transform 200ms ease-in;
}
#revealedActions {
background: #555;color: #fff;
text-align: center;
position: absolute;
width: 100%;
z-index: -10;
}</code>

View the Demo (only tested on iPhone)

10/10/10 10:10

10/10/10 10:10 - where I was:

Review: Surprised by Grace

Surprised by Grace: God's Relentless Pursuit of RebelsSurprised by Grace: God's Relentless Pursuit of Rebels by Tullian Tchividjian

My rating: 5 of 5 stars

Very clear and challenging look at the book of Jonah, showing us that the gospel is not just for those who haven't yet heard it but something that we as Christians need to keep coming back to. The book of Jonah points us to God and how he deals with Jonah's rebellion and ultimately our own rebellion.

View all my reviews

MySQL Locking

After experimenting a bit with MySQL locking today, I thought I'd make a note of what I'd discovered:

To create a lock, you need to use:

<code>LOCK TABLES table1 [READ |WRITE], table2 [READ |WRITE]</code>

READ is used to stop other people changing the table while you read from it. WRITE is used to stop other people reading the table while you write to it.

Once you have issued a LOCK TABLES statement, you will not have access to any tables you didn't include.

When you have finished, you can issue the UNLOCK TABLES command.

The lock remains until you issue the UNLOCK TABLES command, your session ends, you start a transaction or your client is disconnected.

The MySQL locking mechanism is no use if you need to lock something between PHP requests, unless you have a separate process running persistently to maintain the connection to the database.

Jonah Header

Our new Momentum devotional series on Jonah started today - here's a glimpse of my header design.