A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 706
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 576
Function: getReplies

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/system/core/Exceptions.php:271)

Filename: view/rss.php

Line Number: 2

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/rss.php
Line: 2
Function: header

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 579
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Codemirror test - Stikked Codemirror test - Stikked http://geopaste.scratchbook.ch/ en LaTeX http://geopaste.scratchbook.ch/view/81024361 Thu, 19 Apr 2012 21:37:50 +0200 Edgy Bird http://geopaste.scratchbook.ch/view/81024361
  1. \begin{module}[id=bbt-size]
  2. \importmodule[balanced-binary-trees]{balanced-binary-trees}
  3. \importmodule[\KWARCslides{dmath/en/cardinality}]{cardinality}
  4.  
  5. \begin{frame}
  6.  \frametitle{Size Lemma for Balanced Trees}
  7.  \begin{itemize}
  8.  \item
  9.    \begin{assertion}[id=size-lemma,type=lemma]
  10.    Let $G=\tup{V,E}$ be a \termref[cd=binary-trees]{balanced binary tree}
  11.    of \termref[cd=graph-depth,name=vertex-depth]{depth}$n>i$, then the set
  12.     $\defeq{\livar{V}i}{\setst{\inset{v}{V}}{\gdepth{v} = i}}$ of
  13.    \termref[cd=graphs-intro,name=node]{nodes} at
  14.    \termref[cd=graph-depth,name=vertex-depth]{depth} $i$ has
  15.    \termref[cd=cardinality,name=cardinality]{cardinality} $\power2i$.
  16.   \end{assertion}
  17.  \item
  18.    \begin{sproof}[id=size-lemma-pf,proofend=,for=size-lemma]{via induction over the depth $i$.}
  19.      \begin{spfcases}{We have to consider two cases}
  20.        \begin{spfcase}{$i=0$}
  21.          \begin{spfstep}[display=flow]
  22.            then $\livar{V}i=\set{\livar{v}r}$, where $\livar{v}r$ is the root, so
  23.            $\eq{\card{\livar{V}0},\card{\set{\livar{v}r}},1,\power20}$.
  24.          \end{spfstep}
  25.        \end{spfcase}
  26.        \begin{spfcase}{$i>0$}
  27.          \begin{spfstep}[display=flow]
  28.           then $\livar{V}{i-1}$ contains $\power2{i-1}$ vertexes
  29.           \begin{justification}[method=byIH](IH)\end{justification}
  30.          \end{spfstep}
  31.          \begin{spfstep}
  32.           By the \begin{justification}[method=byDef]definition of a binary
  33.              tree\end{justification}, each $\inset{v}{\livar{V}{i-1}}$ is a leaf or has
  34.            two children that are at depth $i$.
  35.          \end{spfstep}
  36.          \begin{spfstep}
  37.           As $G$ is \termref[cd=balanced-binary-trees,name=balanced-binary-tree]{balanced} and $\gdepth{G}=n>i$, $\livar{V}{i-1}$ cannot contain
  38.            leaves.
  39.          \end{spfstep}
  40.          \begin{spfstep}[type=conclusion]
  41.           Thus $\eq{\card{\livar{V}i},{\atimes[cdot]{2,\card{\livar{V}{i-1}}}},{\atimes[cdot]{2,\power2{i-1}}},\power2i}$.
  42.          \end{spfstep}
  43.        \end{spfcase}
  44.      \end{spfcases}
  45.    \end{sproof}
  46.  \item
  47.     \begin{assertion}[id=fbbt,type=corollary]  
  48.      A fully balanced tree of depth $d$ has $\power2{d+1}-1$ nodes.
  49.    \end{assertion}
  50.  \item
  51.      \begin{sproof}[for=fbbt,id=fbbt-pf]{}
  52.        \begin{spfstep}
  53.          Let $\defeq{G}{\tup{V,E}}$ be a fully balanced tree
  54.        \end{spfstep}
  55.        \begin{spfstep}
  56.          Then $\card{V}=\Sumfromto{i}1d{\power2i}= \power2{d+1}-1$.
  57.        \end{spfstep}
  58.      \end{sproof}
  59.    \end{itemize}
  60.  \end{frame}
  61. \begin{note}
  62.  \begin{omtext}[type=conclusion,for=binary-tree]
  63.    This shows that balanced binary trees grow in breadth very quickly, a consequence of
  64.    this is that they are very shallow (and this compute very fast), which is the essence of
  65.    the next result.
  66.  \end{omtext}
  67. \end{note}
  68. \end{module}
  69.  
  70. %%% Local Variables:
  71. %%% mode: LaTeX
  72. %%% TeX-master: "all"
  73. %%% End: \end{document}
  74.  
]]>
Diff http://geopaste.scratchbook.ch/view/38043878 Thu, 19 Apr 2012 21:37:10 +0200 Mammoth Meerkat http://geopaste.scratchbook.ch/view/38043878
  1. diff --git a/index.html b/index.html
  2. index c1d9156..7764744 100644
  3. --- a/index.html
  4. +++ b/index.html
  5. @@ -95,7 +95,8 @@ StringStream.prototype = {
  6.      <script>
  7.        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  8.          lineNumbers: true,
  9. -        autoMatchBrackets: true
  10. +        autoMatchBrackets: true,
  11. +      onGutterClick: function(x){console.log(x);}
  12.        });
  13.      </script>
  14.    </body>
  15. diff --git a/lib/codemirror.js b/lib/codemirror.js
  16. index 04646a9..9a39cc7 100644
  17. --- a/lib/codemirror.js
  18. +++ b/lib/codemirror.js
  19. @@ -399,10 +399,16 @@ var CodeMirror = (function() {
  20.      }
  21.  
  22.      function onMouseDown(e) {
  23. -      var start = posFromMouse(e), last = start;
  24. +      var start = posFromMouse(e), last = start, target = e.target();
  25.        if (!start) return;
  26.        setCursor(start.line, start.ch, false);
  27.        if (e.button() != 1) return;
  28. +      if (target.parentNode == gutter) {
  29. +        if (options.onGutterClick)
  30. +          options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom);
  31. +        return;
  32. +      }
  33. +
  34.        if (!focused) onFocus();
  35.  
  36.        e.stop();
  37. @@ -808,7 +814,7 @@ var CodeMirror = (function() {
  38.        for (var i = showingFrom; i < showingTo; ++i) {
  39.          var marker = lines[i].gutterMarker;
  40.          if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>');
  41. -        else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>");
  42. +        else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>");
  43.        }
  44.        gutter.style.display = "none"; // TODO test whether this actually helps
  45.        gutter.innerHTML = html.join("");
  46. @@ -1371,10 +1377,8 @@ var CodeMirror = (function() {
  47.          if (option == "parser") setParser(value);
  48.          else if (option === "lineNumbers") setLineNumbers(value);
  49.          else if (option === "gutter") setGutter(value);
  50. -        else if (option === "readOnly") options.readOnly = value;
  51. -        else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);}
  52. -        else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value;
  53. -        else throw new Error("Can't set option " + option);
  54. +        else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);}
  55. +        else options[option] = value;
  56.        },
  57.        cursorCoords: cursorCoords,
  58.        undo: operation(undo),
  59. @@ -1402,7 +1406,8 @@ var CodeMirror = (function() {
  60.        replaceRange: operation(replaceRange),
  61.  
  62.        operation: function(f){return operation(f)();},
  63. -      refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}
  64. +      refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
  65. +      getInputField: function(){return input;}
  66.      };
  67.      return instance;
  68.    }
  69. @@ -1420,6 +1425,7 @@ var CodeMirror = (function() {
  70.      readOnly: false,
  71.      onChange: null,
  72.      onCursorActivity: null,
  73. +    onGutterClick: null,
  74.      autoMatchBrackets: false,
  75.      workTime: 200,
  76.      workDelay: 300,
  77.  
]]>
C http://geopaste.scratchbook.ch/view/50378554 Thu, 19 Apr 2012 21:36:34 +0200 Eratic Mousedeer http://geopaste.scratchbook.ch/view/50378554
  1. /* C demo code */
  2.  
  3. #include <zmq.h>
  4. #include <pthread.h>
  5. #include <semaphore.h>
  6. #include <time.h>
  7. #include <stdio.h>
  8. #include <fcntl.h>
  9. #include <malloc.h>
  10.  
  11. typedef struct {
  12.   void* arg_socket;
  13.   zmq_msg_t* arg_msg;
  14.   char* arg_string;
  15.   unsigned long arg_len;
  16.   int arg_int, arg_command;
  17.  
  18.   int signal_fd;
  19.   int pad;
  20.   void* context;
  21.   sem_t sem;
  22. } acl_zmq_context;
  23.  
  24. #define p(X) (context->arg_##X)
  25.  
  26. void* zmq_thread(void* context_pointer) {
  27.   acl_zmq_context* context = (acl_zmq_context*)context_pointer;
  28.   char ok = 'K', err = 'X';
  29.   int res;
  30.  
  31.   while (1) {
  32.     while ((res = sem_wait(&context->sem)) == EINTR);
  33.     if (res) {write(context->signal_fd, &err, 1); goto cleanup;}
  34.     switch(p(command)) {
  35.     case 0: goto cleanup;
  36.     case 1: p(socket) = zmq_socket(context->context, p(int)); break;
  37.     case 2: p(int) = zmq_close(p(socket)); break;
  38.     case 3: p(int) = zmq_bind(p(socket), p(string)); break;
  39.     case 4: p(int) = zmq_connect(p(socket), p(string)); break;
  40.     case 5: p(int) = zmq_getsockopt(p(socket), p(int), (void*)p(string), &p(len)); break;
  41.     case 6: p(int) = zmq_setsockopt(p(socket), p(int), (void*)p(string), p(len)); break;
  42.     case 7: p(int) = zmq_send(p(socket), p(msg), p(int)); break;
  43.     case 8: p(int) = zmq_recv(p(socket), p(msg), p(int)); break;
  44.     case 9: p(int) = zmq_poll(p(socket), p(int), p(len)); break;
  45.     }
  46.     p(command) = errno;
  47.     write(context->signal_fd, &ok, 1);
  48.   }
  49.  cleanup:
  50.   close(context->signal_fd);
  51.   free(context_pointer);
  52.   return 0;
  53. }
  54.  
  55. void* zmq_thread_init(void* zmq_context, int signal_fd) {
  56.   acl_zmq_context* context = malloc(sizeof(acl_zmq_context));
  57.   pthread_t thread;
  58.  
  59.   context->context = zmq_context;
  60.   context->signal_fd = signal_fd;
  61.   sem_init(&context->sem, 1, 0);
  62.   pthread_create(&thread, 0, &zmq_thread, context);
  63.   pthread_detach(thread);
  64.   return context;
  65. }
  66.  
]]>
Bash http://geopaste.scratchbook.ch/view/25946974 Thu, 19 Apr 2012 21:35:25 +0200 Fiery Pudu http://geopaste.scratchbook.ch/view/25946974
  1. #!/bin/bash
  2.  
  3. # clone the repository
  4. git clone http://github.com/garden/tree
  5.  
  6. # generate HTTPS credentials
  7. cd tree
  8. openssl genrsa -aes256 -out https.key 1024
  9. openssl req -new -nodes -key https.key -out https.csr
  10. openssl x509 -req -days 365 -in https.csr -signkey https.key -out https.crt
  11. cp https.key{,.orig}
  12. openssl rsa -in https.key.orig -out https.key
  13.  
  14. # start the server in HTTPS mode
  15. cd web
  16. sudo node ../server.js 443 'yes' &gt;&gt; ../node.log &amp;
  17.  
  18. # here is how to stop the server
  19. for pid in `ps aux | grep 'node ../server.js' | awk '{print $2}'` ; do
  20.   sudo kill -9 $pid 2&gt; /dev/null
  21. done
  22.  
  23. exit 0
]]>
Ruby http://geopaste.scratchbook.ch/view/92347544 Thu, 19 Apr 2012 21:34:03 +0200 Bistre Motmot http://geopaste.scratchbook.ch/view/92347544
  1. # Code from http://sandbox.mc.edu/~bennet/ruby/code/poly_rb.html
  2. #
  3. # This program evaluates polynomials.  It first asks for the coefficients
  4. # of a polynomial, which must be entered on one line, highest-order first.
  5. # It then requests values of x and will compute the value of the poly for
  6. # each x.  It will repeatly ask for x values, unless you the user enters
  7. # a blank line.  It that case, it will ask for another polynomial.  If the
  8. # user types quit for either input, the program immediately exits.
  9. #
  10.  
  11. #
  12. # Function to evaluate a polynomial at x.  The polynomial is given
  13. # as a list of coefficients, from the greatest to the least.
  14. def polyval(x, coef)
  15.     sum = 0
  16.     coef = coef.clone           # Don't want to destroy the original
  17.     while true
  18.         sum += coef.shift       # Add and remove the next coef
  19.         break if coef.empty?    # If no more, done entirely.
  20.         sum *= x                # This happens the right number of times.
  21.     end
  22.     return sum
  23. end
  24.  
  25. #
  26. # Function to read a line containing a list of integers and return
  27. # them as an array of integers.  If the string conversion fails, it
  28. # throws TypeError.  If the input line is the word 'quit', then it
  29. # converts it to an end-of-file exception
  30. def readints(prompt)
  31.     # Read a line
  32.     print prompt
  33.     line = readline.chomp
  34.     raise EOFError.new if line == 'quit' # You can also use a real EOF.
  35.            
  36.     # Go through each item on the line, converting each one and adding it
  37.     # to retval.
  38.     retval = [ ]
  39.     for str in line.split(/\s+/)
  40.         if str =~ /^\-?\d+$/
  41.             retval.push(str.to_i)
  42.         else
  43.             raise TypeError.new
  44.         end
  45.     end
  46.  
  47.     return retval
  48. end
  49.  
  50. #
  51. # Take a coeff and an exponent and return the string representation, ignoring
  52. # the sign of the coefficient.
  53. def term_to_str(coef, exp)
  54.     ret = ""
  55.  
  56.     # Show coeff, unless it's 1 or at the right
  57.     coef = coef.abs
  58.     ret = coef.to_s     unless coef == 1 && exp > 0
  59.     ret += "x" if exp > 0                               # x if exponent not 0
  60.     ret += "^" + exp.to_s if exp > 1                    # ^exponent, if > 1.
  61.  
  62.     return ret
  63. end
  64.  
  65. #
  66. # Create a string of the polynomial in sort-of-readable form.
  67. def polystr(p)
  68.     # Get the exponent of first coefficient, plus 1.
  69.     exp = p.length
  70.  
  71.     # Assign exponents to each term, making pairs of coeff and exponent,
  72.     # Then get rid of the zero terms.
  73.     p = (p.map { |c| exp -= 1; [ c, exp ] }).select { |p| p[0] != 0 }
  74.  
  75.     # If there's nothing left, it's a zero
  76.     return "0" if p.empty?
  77.  
  78.     # *** Now p is a non-empty list of [ coef, exponent ] pairs. ***
  79.  
  80.     # Convert the first term, preceded by a "-" if it's negative.
  81.     result = (if p[0][0] < 0 then "-" else "" end) + term_to_str(*p[0])
  82.  
  83.     # Convert the rest of the terms, in each case adding the appropriate
  84.     # + or - separating them.  
  85.     for term in p[1...p.length]
  86.         # Add the separator then the rep. of the term.
  87.         result += (if term[0] < 0 then " - " else " + " end) +
  88.                 term_to_str(*term)
  89.     end
  90.  
  91.     return result
  92. end
  93.        
  94. #
  95. # Run until some kind of endfile.
  96. begin
  97.     # Repeat until an exception or quit gets us out.
  98.     while true
  99.         # Read a poly until it works.  An EOF will except out of the
  100.         # program.
  101.         print "\n"
  102.         begin
  103.             poly = readints("Enter a polynomial coefficients: ")
  104.         rescue TypeError
  105.             print "Try again.\n"
  106.             retry
  107.         end
  108.         break if poly.empty?
  109.  
  110.         # Read and evaluate x values until the user types a blank line.
  111.         # Again, an EOF will except out of the pgm.
  112.         while true
  113.             # Request an integer.
  114.             print "Enter x value or blank line: "
  115.             x = readline.chomp
  116.             break if x == ''
  117.             raise EOFError.new if x == 'quit'
  118.  
  119.             # If it looks bad, let's try again.
  120.             if x !~ /^\-?\d+$/
  121.                 print "That doesn't look like an integer.  Please try again.\n"
  122.                 next
  123.             end
  124.  
  125.             # Convert to an integer and print the result.
  126.             x = x.to_i
  127.             print "p(x) = ", polystr(poly), "\n"
  128.             print "p(", x, ") = ", polyval(x, poly), "\n"
  129.         end
  130.     end
  131. rescue EOFError
  132.     print "\n=== EOF ===\n"
  133. rescue Interrupt, SignalException
  134.     print "\n=== Interrupted ===\n"
  135. else
  136.     print "--- Bye ---\n"
  137. end
  138.  
]]>
Python http://geopaste.scratchbook.ch/view/36890130 Thu, 19 Apr 2012 21:31:45 +0200 Colossal Flamingo http://geopaste.scratchbook.ch/view/36890130
  1. # Literals
  2. 1234
  3. 0.0e101
  4. .123
  5. 0b01010011100
  6. 0o01234567
  7. 0x0987654321abcdef
  8. 7
  9. 2147483647
  10. 3L
  11. 79228162514264337593543950336L
  12. 0x100000000L
  13. 79228162514264337593543950336
  14. 0xdeadbeef
  15. 3.14j
  16. 10.j
  17. 10j
  18. .001j
  19. 1e100j
  20. 3.14e-10j
  21.  
  22.  
  23. # String Literals
  24. 'For\''
  25. "God\""
  26. """so loved
  27. the world"""
  28. '''that he gave
  29. his only begotten\' '''
  30. 'that whosoever believeth \
  31. in him'
  32. ''
  33.  
  34. # Identifiers
  35. __a__
  36. a.b
  37. a.b.c
  38.  
  39. # Operators
  40. + - * / % & | ^ ~ < >
  41. == != <= >= <> << >> // **
  42. and or not in is
  43.  
  44. # Delimiters
  45. () [] {} , : ` = ; @ .  # Note that @ and . require the proper context.
  46. += -= *= /= %= &= |= ^=
  47. //= >>= <<= **=
  48.  
  49. # Keywords
  50. as assert break class continue def del elif else except
  51. finally for from global if import lambda pass raise
  52. return try while with yield
  53.  
  54. # Python 2 Keywords (otherwise Identifiers)
  55. exec print
  56.  
  57. # Python 3 Keywords (otherwise Identifiers)
  58. nonlocal
  59.  
  60. # Types
  61. bool classmethod complex dict enumerate float frozenset int list object
  62. property reversed set slice staticmethod str super tuple type
  63.  
  64. # Python 2 Types (otherwise Identifiers)
  65. basestring buffer file long unicode xrange
  66.  
  67. # Python 3 Types (otherwise Identifiers)
  68. bytearray bytes filter map memoryview open range zip
  69.  
  70. # Some Example code
  71. import os
  72. from package import ParentClass
  73.  
  74. @nonsenseDecorator
  75. def doesNothing():
  76.     pass
  77.  
  78. class ExampleClass(ParentClass):
  79.     @staticmethod
  80.     def example(inputStr):
  81.         a = list(inputStr)
  82.         a.reverse()
  83.         return ''.join(a)
  84.  
  85.     def __init__(self, mixin = 'Hello'):
  86.         self.mixin = mixin
  87.  
]]>
PHP http://geopaste.scratchbook.ch/view/69866672 Thu, 19 Apr 2012 21:30:50 +0200 Eratic Butterfly http://geopaste.scratchbook.ch/view/69866672
  1. <?php
  2. function hello($who) {
  3.         return "Hello " . $who;
  4. }
  5. ?>
  6. <p>The program says <?= hello("World") ?>.</p>
  7. <script>
  8.         alert("And here is some JS code"); // also colored
  9. </script>
  10.  
]]>
JavaScript http://geopaste.scratchbook.ch/view/5259832 Thu, 19 Apr 2012 21:29:44 +0200 Sludgy Gibbon http://geopaste.scratchbook.ch/view/5259832
  1. // Demo code (the actual new parser character stream implementation)
  2.  
  3. function StringStream(string) {
  4.   this.pos = 0;
  5.   this.string = string;
  6. }
  7.  
  8. StringStream.prototype = {
  9.   done: function() {return this.pos >= this.string.length;},
  10.   peek: function() {return this.string.charAt(this.pos);},
  11.   next: function() {
  12.     if (this.pos < this.string.length)
  13.       return this.string.charAt(this.pos++);
  14.   },
  15.   eat: function(match) {
  16.     var ch = this.string.charAt(this.pos);
  17.     if (typeof match == "string") var ok = ch == match;
  18.     else var ok = ch && match.test ? match.test(ch) : match(ch);
  19.     if (ok) {this.pos++; return ch;}
  20.   },
  21.   eatWhile: function(match) {
  22.     var start = this.pos;
  23.     while (this.eat(match));
  24.     if (this.pos > start) return this.string.slice(start, this.pos);
  25.   },
  26.   backUp: function(n) {this.pos -= n;},
  27.   column: function() {return this.pos;},
  28.   eatSpace: function() {
  29.     var start = this.pos;
  30.     while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
  31.     return this.pos - start;
  32.   },
  33.   match: function(pattern, consume, caseInsensitive) {
  34.     if (typeof pattern == "string") {
  35.       function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
  36.       if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
  37.         if (consume !== false) this.pos += str.length;
  38.         return true;
  39.       }
  40.     }
  41.     else {
  42.       var match = this.string.slice(this.pos).match(pattern);
  43.       if (match && consume !== false) this.pos += match[0].length;
  44.       return match;
  45.     }
  46.   }
  47. };
  48.  
]]>
CSS http://geopaste.scratchbook.ch/view/83189938 Thu, 19 Apr 2012 21:28:31 +0200 Sweet Earthworm http://geopaste.scratchbook.ch/view/83189938
  1. /* Some example CSS */
  2.  
  3. @import url("something.css");
  4.  
  5. body {
  6.   margin: 0;
  7.   padding: 3em 6em;
  8.   font-family: tahoma, arial, sans-serif;
  9.   color: #000;
  10. }
  11.  
  12. #navigation a {
  13.   font-weight: bold;
  14.   text-decoration: none !important;
  15. }
  16.  
  17. h1 {
  18.   font-size: 2.5em;
  19. }
  20.  
  21. h2 {
  22.   font-size: 1.7em;
  23. }
  24.  
  25. h1:before, h2:before {
  26.   content: "::";
  27. }
  28.  
  29. code {
  30.   font-family: courier, monospace;
  31.   font-size: 80%;
  32.   color: #418A8A;
  33. }
  34.  
]]>
HTML http://geopaste.scratchbook.ch/view/39156869 Thu, 19 Apr 2012 21:27:56 +0200 Chocolate Bushbaby http://geopaste.scratchbook.ch/view/39156869
  1. <html style="color: green">
  2.   <!-- this is a comment -->
  3.   <head>
  4.     <title>Mixed HTML Example</title>
  5.     <style type="text/css">
  6.       h1 {font-family: comic sans; color: #f0f;}
  7.       div {background: yellow !important;}
  8.       body {
  9.         max-width: 50em;
  10.         margin: 1em 2em 1em 5em;
  11.       }
  12.     </style>
  13.   </head>
  14.   <body>
  15.     <h1>Mixed HTML Example</h1>
  16.     <script>
  17.       function jsFunc(arg1, arg2) {
  18.         if (arg1 && arg2) document.body.innerHTML = "achoo";
  19.       }
  20.     </script>
  21.   </body>
  22. </html>
  23.  
]]>