Q:

Is clipping directly onto a dyneema sling safe? 

I was recently doing a scramble route in North Wales.  We needed to get past a large rock spike, though easy climbing, it was quite exposed and not a good place to take a fall.  As a safety backup I attached a long dyneema sling over a large spike and clipped this directly onto my harness.  This was more confidence protection than anything as the move was straight forward.  
We did this for speed, we did have a rope but didn't want to spend the time getting it out, etc.  just to pass a relatively small section. 
It occurred to me afterwards though that maybe this wasn't such a great idea.  There was nothing in the system to really absorb any impact.  The fall onto the sling would have been minimal (maybe 1m). 
Are there any problems with attaching a sling directly onto your harness like this?  We didn't use a crows foot or any other knot.  Just a sling and one carabiner. 
Here's a video of my girlfriend doing the above for context

A:

Was it better than no protection?  Probably.  Would I recommend it?  No. 
The reason is this: DMM performed some tests where they anchored a sling to a carabiner and a load (80kg), and dropped the load from various heights.  The results are a bit more nuanced, but the gist is that you should never fall onto a sling from at or above the anchor without any dynamic elements in the system.  This sentence sums it up nicely: 

Even a 60 cm fall-factor 1 fall on to an open Dyneema® sling can generate enough impact force (16.7 kN) at the anchor to pull a Wallnut 11 wire (12 kN) apart.  Tying a knot in a Dyneema® sling weakens it even further leading to sling failure in a fall-factor 1 loading on to a 120 cm sling. 

You probably wouldn't want to experience a force of 16.7 kN, which is what would happen if you fell with the harness at the height of the anchor.  
However, it might be fine if you stay well below the highest point of the anchor.  But I couldn't find any reference to that situation, so I can't comment on that situation specifically.  

A:

It certainly isn't safe to use a sling or anything else which will not absorb shock in the event of a fall. 
Although you are probably not likely to have this sort of thing while scrambling, if you know are going to need to clip in to something for some reason, you could always take a tip from caving and use dynamic rope to make up what we call "cowstails".  These are used regularly in caving while abseiling and prusiking up ropes and on traverse lines to clip into as a safeguard in case of a slip or equipment failure.  We use two at a time as it makes certain manouvres easier and safer but for your purpose just one would be better than a sling which absorbs no shock in the event of a fall.  
For example of a caver's "cowstails":
 
NOTE: It is possible to take a fall with a very large Fall Factor on Via Ferrata, which is why Via Ferrata "lanyards" have a means of allowing the rope to slip through some sort of fall protector (or have elasticated sections held together by stitching which will burst during a fall) in order to absorb the possible very large shock.  The intention with cowstails is NOT to fall but to prevent a fall from happening.  However if you do fall (and you should never climb above the item to which they are attached) it should only by with a small Fall Factor and onto dynamic rope.  Cavers normally attach the costails to their harness using the Maillon Rapide which joins the two sides of the harness at the front and centre, by using the loop tied in the rope between the two karabiners in the picture above.  A Maillon Rapide is used as it can take a 3-way directional loading safely, which an ordinary karabiner cannot, unless it is a specialised karabiner such as the Petz Omni whcih is designed to do this. 

A:

In the specific example of the video of your girlfriend, what you did seems to me like a perfectly reasonable way of dealing with that spot in the climb.  When we talk about the bad consequences of taking a short fall on a static line (wrecking pro, snapping slings, injuries to the climber's pelvis), we're talking mainly about factor-2 falls on a vertical wall.  In the situation you were in, it would have been factor-1 at most, and realistically not anywhere near that bad, because she would have been scraping, scrabbling, and bumping on her way down. 
I can't really second-guess your judgment based on the view through a cell phone's lens, but if I speculate about the situation if I'd been there and could have seen the total situation more clearly, my concerns might have been completely different.  The section before the sling looks exposed, and I would have worried about the possibility of bad rock or of a simple foot slip on a sandy ledge.  I also might have worried about the horn that you threw the sling over -- whether or not it was solidly attached to the ridge.