Skip to content

Instantly share code, notes, and snippets.

.org $8000
.org $ff00
XAML = $24 ; Last "opened" location Low
XAMH = $25 ; Last "opened" location High
STL = $26 ; Store address Low
STH = $27 ; Store address High
L = $28 ; Hex value parsing Low
H = $29 ; Hex value parsing High
YSAV = $2A ; Used to see if hex value is given
@beneater
beneater / gist:2790785
Created May 25, 2012 21:46
Add an exercise topic
$.ajax({
url: "/api/v1/topicversion/default/maplayout",
type: "GET",
success: function(maplayout) {
maplayout.topics["logical-reasoning"] = {}
maplayout.topics["logical-reasoning"].icon_url = "/images/power-mode/badges/default-40x40.png"
maplayout.topics["logical-reasoning"].id = "logical-reasoning"
maplayout.topics["logical-reasoning"].standalone_title = "Logical reasoning"
maplayout.topics["logical-reasoning"].x = -29
maplayout.topics["logical-reasoning"].y = 40
@beneater
beneater / gist:2255628
Created March 30, 2012 21:50
Power mode topic migration shtuff
//
// Set map layout
//
function setLayout( data ) {
jQuery.ajax({
url: "/api/v1/maplayout",
type: "PUT",
contentType: "application/json",
data: JSON.stringify( data ),
<div class="solution" data-type="custom">
<div class="instruction">
Enter the factored expression here:<br>
<input name="response" type="text"></input>
</div>
<div class="guess">jQuery( "div.instruction input" ).val()</div>
<div class="validator-function">
return MATH.isEqual(MATH.parse(guess), SOLUTION)
</div>
<div class="show-guess">
--- /usr/share/vim/vim72/syntax/html.vim 2012-01-08 19:47:38.000000000 -0500
+++ /Users/eater/.vim/syntax/html.vim 2012-01-11 21:59:47.000000000 -0500
@@ -183,6 +183,20 @@
" a javascript expression is used as an arg value
syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
+
+
+ " javascript inside var tags
+ syn region javaScript start=+<var[^>]*>+ keepend end=+</var>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlVarTag,@htmlPreproc
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
<span class="sol"><var>X1</var></span>
<span class="sol"><var>Y1</var></span>
</div>
<div class="set-sol" data-type="multiple">
<span class="sol"><var>X2</var></span>
<span class="sol"><var>Y2</var></span>
</div>
<div class="solution" data-type="interactive">
<div class="instruction">
Drag the two points to move the line into the correct position.
</div>
<div class="guess"> [ graph.pointA.coord, graph.pointB.coord ] </div>
<div class="validator-function">
var slope = ( guess[1][1] - guess[0][1] ) / ( guess[1][0] - guess[0][0] );
var yint = slope * ( 0 - guess[0][0] ) + guess[0][1];
return abs( SLOPE - slope ) &lt; 0.001 &amp;&amp; abs( YINT - yint ) &lt; 0.001;
</div>
<p class="solution"><code><var>plus( A+X, A*YSIGN+Y, B )</var></code></p>
<ul class="choices" data-show="5" data-none="true">
<li><code><var>plus( A+X, YSIGN+Y, B )</var></code></li>
<li><code><var>plus( A+X, YSIGN+Y, A*B )</var></code></li>
<li><code><var>plus( A, X, YSIGN+Y, B )</var></code></li>
<div data-if="A != 1" data-unwrap>
<li><code><var>plus( A+X, A+Y )</var> + <var>FRAC( B , A )</var></code></li>
<li><code><var>FRAC( 1, A )</var><var>X</var> + <var>FRAC( YSIGN, A )</var><var>Y</var> + <var>B</var></code></li>
</div>
<li><code><var>plus( A+X, A*YSIGN+Y, A+B )</var></code></li>