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
| (function selectionPolyfill(window, document) { | |
| if (window.getSelection || !document.selection) return; | |
| // convert an IE TextRange to a W3C one | |
| function convert(range, startOrEnd) { | |
| var point = range.duplicate() | |
| , result = {}; | |
| // point is either the start or end of the range | |
| point.collapse(startOrEnd); |
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
| /*jslint vars: true, indent: 2 */ | |
| /*global Utils*/ | |
| (function (exports) { | |
| "use strict"; | |
| function matchesCompoundSelector(element, compoundSelector) { | |
| // only tagName + ('.' + className) * | |
| var tagName = compoundSelector[0]; | |
| if (tagName !== null && !tagName.test(element.nodeName)) { |
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
| // testharness.js | |
| var t = async_test("Timeout times out"); | |
| setTimeout(t.step_func(function () { | |
| assert_true(true); | |
| t.done(); | |
| }), 100); | |
| // Jasmine | |
| describe("Timeout", function () { |
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
| /** | |
| * Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes. | |
| * @param {string|number|object} theValue | |
| * @param {string} sDelimiter The string delimiter. Defaults to a double quote (") if omitted. | |
| */ | |
| function toCsvValue(theValue, sDelimiter) { | |
| var t = typeof (theValue), output; | |
| if (typeof (sDelimiter) === "undefined" || sDelimiter === null) { | |
| sDelimiter = '"'; |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <assert.h> | |
| #include <stdbool.h> | |
| #include "aatree.h" | |
| static aanode* new_aanode(const int key, void *val, aanode *nullnode) { | |
| aanode *n = (aanode*)malloc(sizeof(aanode)); | |
| if(n == NULL) return NULL; | |
| n->key = key; |
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
| /** | |
| * Centered Vertical line with CSS Gradient | |
| */ | |
| div { | |
| background: #fff; | |
| background: linear-gradient(180deg, transparent, #353535, transparent); | |
| background-position: 50%; | |
| background-repeat: repeat-y; | |
| background-size: 1px auto; | |
| } |
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
| /* | |
| * DOMParser HTML extension | |
| * 2019-11-13 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ | |
| /*! @source https://gist.github.com/1129031 */ |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Sebastien P. https://twitter.com/#!/_sebastienp | |
| Special thanks to @subzey (you rock) and @kbjr ! | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. |
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
| /* | |
| * node-ws - pure Javascript WebSockets server | |
| * Copyright Bradley Wright <[email protected]> | |
| */ | |
| // Use strict compilation rules - we're not animals | |
| 'use strict'; | |
| var net = require('net'), | |
| crypto = require('crypto'); |
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
| <html> | |
| <head> | |
| <script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
| </head> | |
| <body> | |
| <h2>Naive canvas</h2> | |
| <canvas id="naive" width="400" height="50"></canvas> | |
| <h2>High-def Canvas</h2> |