This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.nio.CharBuffer; | |
| import java.nio.BufferUnderflowException; | |
| /** | |
| * A single-method JSON parser in 100 lines of Java. | |
| * | |
| * Returns a String, Boolean, Integer, Long, Double, null, a List of those, or a Map<String,Object> of those. | |
| * Intended to parse input which is expected to be valid. If you want 100% correct error handling, go elsewhere. | |
| * Does not exacly match the JSON parsing rules for numbers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| It's a simple one-liner - add this to your code, just be aware it impacts ALL buffers | |
| Buffer.prototype.toJSON = function() { return this.toString("base64"); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <style> | |
| .outer { | |
| display:inline-block; | |
| } | |
| .outer div { | |
| width: 100px; | |
| height: 50px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> | |
| <mrow> | |
| <mfenced> | |
| <mtable> | |
| <mtr> | |
| <mtd> | |
| <mfenced> | |
| <mtable> | |
| <mtr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <style> | |
| :root { | |
| counter-reset: page 0 b 0 e 0; | |
| } | |
| @page { | |
| counter-increment: page 1 b 1; | |
| margin: 36px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>Force Line Breaking test</title> | |
| <style> | |
| section { | |
| margin-top: 2em; | |
| } | |
| p { | |
| margin: 0.5em; |