<?xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        >
<channel>
  <title>asgaard</title>
  <description></description>
  <link>https://blog.asgaard.co.uk/2012/9</link>
  <lastBuildDate>Tue, 12 May 26 17:20:40 +0000</lastBuildDate>
  <language>en</language>
  <count>3</count>
  <offset>0</offset>
      <item>
    <title>Falkenbach - Asaland Guitar Pro Tab</title>
    <link>https://blog.asgaard.co.uk/2012/09/26/falkenbach-asaland-guitar-pro-tab</link>
    <pubDate>Wed, 26 Sep 12 10:47:41 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2012/09/26/falkenbach-asaland-guitar-pro-tab</guid>
    <description><![CDATA[
<p>
<a href='/assets/media/user/asaland-1.gpx'>Download</a>
<p>
I couldn&#039;t find it anywhere online so I worked it out myself. This is in Guitar Pro 6 format so you&#039;ll need Guitar Pro 6 installed, which if you don&#039;t have already, is a fantastic piece of software (when it works). You&#039;ll get get playback that sounds something like this:
<p>
<audio src='/assets/media/user/asaland-1.ogg' controls='1'>Your browser does not support the audio tag. Try using Chrome.</audio>
<p>
As for the transcription quality: 
<br>
+ The original is really reverby which makes some things hard to hear clearly. I think there are two acoustic guitars but it might be that there&#039;s just a quarter-note delay on the lead. I&#039;ve got it as two anyway.
<br>
+ The high synth might be slightly wrong in places...  It kind of rolls around and fades in and out a bit. It&#039;s hard to make out. The way I have it looks a bit strange on paper, D5 -&gt; Gsus4 -&gt; G, but it keeps the high D note constant, which is the prevailing tone throughout, so it could be right.
<br>
+ I&#039;m not a drummer so the drums won&#039;t be exact; they aren&#039;t too bad t[...]]]></description>
    <content:encoded><![CDATA[
<p>
<a href='/assets/media/user/asaland-1.gpx'>Download</a>
<p>
I couldn&#039;t find it anywhere online so I worked it out myself. This is in Guitar Pro 6 format so you&#039;ll need Guitar Pro 6 installed, which if you don&#039;t have already, is a fantastic piece of software (when it works). You&#039;ll get get playback that sounds something like this:
<p>
<audio src='/assets/media/user/asaland-1.ogg' controls='1'>Your browser does not support the audio tag. Try using Chrome.</audio>
<p>
As for the transcription quality: 
<br>
+ The original is really reverby which makes some things hard to hear clearly. I think there are two acoustic guitars but it might be that there&#039;s just a quarter-note delay on the lead. I&#039;ve got it as two anyway.
<br>
+ The high synth might be slightly wrong in places...  It kind of rolls around and fades in and out a bit. It&#039;s hard to make out. The way I have it looks a bit strange on paper, D5 -&gt; Gsus4 -&gt; G, but it keeps the high D note constant, which is the prevailing tone throughout, so it could be right.
<br>
+ I&#039;m not a drummer so the drums won&#039;t be exact; they aren&#039;t too bad though.
<p>
If you find it useful or improve it, please let me know!
<p>
]]></content:encoded>
  </item>
      <item>
    <title>Pseudo elements&#039; CSS with jQuery</title>
    <link>https://blog.asgaard.co.uk/2012/09/08/again-on-manipulating-css-pseudo-elements-with-jquery</link>
    <pubDate>Sat, 08 Sep 12 15:18:12 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2012/09/08/again-on-manipulating-css-pseudo-elements-with-jquery</guid>
    <description><![CDATA[
<p>
Further to what I wrote <a href='http://blog.asgaard.co.uk/2012/09/07/on-targeting-pseudo-elements-with-javascript-jquery'>yesterday</a> about this, I&#039;ve written a jQuery plugin to provide a nice interface to pseudo-element CSS changes. Basically it *kind of* allows you to target pseudo-elements for the sake of CSS manipulation. It looks something like this:
<p>
<pre>$('#element').pseudoCss(':before', 'background-color', 'red');</pre>
<p>
Check out the code from <a href='https://github.com/markwatkinson/jquery-pseudo-css' target='_blank'>GitHub</a>. The index.html contains documentation, which you should be able to see online via <a href='http://htmlpreview.github.com/?https://raw.github.com/markwatkinson/jquery-pseudo-css/master/index.html' target='_blank'>this link</a>.
<p>
Please do read the caveat section before you use it. It should work for most situations but it is inherently limited compared to $.css().[...]]]></description>
    <content:encoded><![CDATA[
<p>
Further to what I wrote <a href='http://blog.asgaard.co.uk/2012/09/07/on-targeting-pseudo-elements-with-javascript-jquery'>yesterday</a> about this, I&#039;ve written a jQuery plugin to provide a nice interface to pseudo-element CSS changes. Basically it *kind of* allows you to target pseudo-elements for the sake of CSS manipulation. It looks something like this:
<p>
<pre>$('#element').pseudoCss(':before', 'background-color', 'red');</pre>
<p>
Check out the code from <a href='https://github.com/markwatkinson/jquery-pseudo-css' target='_blank'>GitHub</a>. The index.html contains documentation, which you should be able to see online via <a href='http://htmlpreview.github.com/?https://raw.github.com/markwatkinson/jquery-pseudo-css/master/index.html' target='_blank'>this link</a>.
<p>
Please do read the caveat section before you use it. It should work for most situations but it is inherently limited compared to $.css().]]></content:encoded>
  </item>
      <item>
    <title>On targeting pseudo-elements with JavaScript/jQuery</title>
    <link>https://blog.asgaard.co.uk/2012/09/07/on-targeting-pseudo-elements-with-javascript-jquery</link>
    <pubDate>Fri, 07 Sep 12 17:18:47 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2012/09/07/on-targeting-pseudo-elements-with-javascript-jquery</guid>
    <description><![CDATA[<aside><strong>Edit</strong>: I&#039;ve written a jQuery plugin to automate some of this for you. If you need this on a bigger than trivial scale, it might be worth checking out! See: <a href='http://htmlpreview.github.com/?https://raw.github.com/markwatkinson/jquery-pseudo-css/master/index.html' target='_blank'>Docs/demo</a> | <a href='https://github.com/markwatkinson/jquery-pseudo-css' target='_blank'>code</a>.
<br>
</aside>
<p>
Pseudo-elements are pretty nice things you can inject into HTML elements via CSS.
<p>
<pre>#container { 
    position: relative;
}
#container::before {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    content: &quot;I am a block element in the top-left corner of #container and I don't exist in the markup&quot;;
}</pre>
<p>
They are very useful for adding presentational output to your DOM tree without needing to pollute the markup. But they are a bit of a pain because they don&#039;t really exist in the DOM, so accessing them programmatically with JavaScript is hard, or I think, impossible in the general case.
<p>
But depending on what you want to do, you might be able to achieve the result you want by being a bit clever... 
<p>
Usually you want to target this element because you intend to manipulate its CSS. You can still manipula[...]]]></description>
    <content:encoded><![CDATA[<aside><strong>Edit</strong>: I&#039;ve written a jQuery plugin to automate some of this for you. If you need this on a bigger than trivial scale, it might be worth checking out! See: <a href='http://htmlpreview.github.com/?https://raw.github.com/markwatkinson/jquery-pseudo-css/master/index.html' target='_blank'>Docs/demo</a> | <a href='https://github.com/markwatkinson/jquery-pseudo-css' target='_blank'>code</a>.
<br>
</aside>
<p>
Pseudo-elements are pretty nice things you can inject into HTML elements via CSS.
<p>
<pre>#container { 
    position: relative;
}
#container::before {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    content: &quot;I am a block element in the top-left corner of #container and I don't exist in the markup&quot;;
}</pre>
<p>
They are very useful for adding presentational output to your DOM tree without needing to pollute the markup. But they are a bit of a pain because they don&#039;t really exist in the DOM, so accessing them programmatically with JavaScript is hard, or I think, impossible in the general case.
<p>
But depending on what you want to do, you might be able to achieve the result you want by being a bit clever... 
<p>
Usually you want to target this element because you intend to manipulate its CSS. You can still manipulate its CSS! You just have to take the indirect and less commonly trodden route of using JS to create a stylesheet and writing raw rules into it. Example:
<p>
<pre>$('head').append(document.createElement('style'));
var myStyleSheet = document.styleSheets[document.styleSheets.length-1];

var myRule = &quot;#container::before { content: \&quot;Let's change my text\&quot;; }&quot;;
if (myStyleSheet.insertRule) {
    myStyleSheet.insertRule(myRule, myStyleSheet.cssRules.length);
}</pre>
<p>
What we&#039;ve done in the code above is to create a dedicated stylesheet for this and then injected a rule which should override the previous rule (assuming selector specifity is equal, but let&#039;s not get into that). This is obviously not as neat as simply using jQuery.css(), but we don&#039;t have too many options, so let&#039;s focus on managing the situation we&#039;ve inherited.<h3>Cool story bro, but how do I scale this?</h3>
<p>
Exactly what strategy you use to lay your code out depends on your exact problem. If you only need to consider changes to one element, just keep it simple.
<p>
But if you need to handle multiple elements individually you have to manage problems selecting them and targeting them individually. If they don&#039;t already have an ID set, you&#039;ll have to create IDs on them and use that in the rule&#039;s selector. The second parameter of insertRule is an index. We can use this to help us out; we can iterate over each of our elements initially and assign it an index (use $.data()), insert a no-op rule at that index to force it to exist, and then make sure that element may only write to that index. After doing so, we&#039;ll still have to remove the old rule which will now be in index+1, which we can do with <code>myStyleSheet.deleteRule(index+1)</code>.
<p>
I&#039;ve made a <a href='http://jsfiddle.net/BtM7g/2/'>fiddle</a> to show roughly how it works. It by no means handles all feasible cases but should give you an idea how to lay things out.]]></content:encoded>
  </item>
  </channel>
</rss>