Language / Prior Art | ‘Valid’ HTML | HTML Mapping | Example | Example with Args |
---|---|---|---|---|
‘Valid’ | CSS Selectable | CSS Mapping | CSS Select | CSS Selector w Args |
JavaScript MooTools | Multiple instance Separate Args | new Foo(element); new Bar(element) |
new Foo(element, {a:"a", bB:"b B", c:{c:1}}); new Bar(element, {d:"d"}) |
|
— | — | — | — | — |
HTML attr Dojo <1.6 | NO |
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
/** | |
* by Dmitry A. Soshnikov | |
*/ | |
Object.defineProperty(Object, "essence", { | |
value: function objectEssence(value) { | |
var essence = {kind: Object.prototype.toString.call(value).slice(8, -1)}; | |
// use Object(value) just for shortness, it's less effective | |
// than typeof value == "object" && value !== null || typeof value == "function" | |
essence[value === Object(value) ? "object" : "primitive"] = true; |
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
var playhead, art, keyframe1, keyframe2; | |
addEvent('load', function(){ | |
art = new ART(400, 400).inject(document.body); | |
playhead = new ART.Rectangle(200, 200) | |
.inject(art) | |
.fill('#00F'); |
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
//media as attribute | |
%script{:src => "/Theme/HUD/screen.css", :media => "screen and (lsd-theme: HUD)"} | |
//media to deliver combined stylesheet | |
button | |
+inline-block | |
@media (lsd-theme: HUD) | |
button | |
&:icon |
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
/** | |
* This library defines a new style ES objects | |
* which support delegation based mixins. A mixin | |
* chain is stored in the internal [[Mixin]] property. | |
* | |
* Used features: Harmony (ES6) proxies. | |
* | |
* Tested in FF4 beta. | |
* | |
* @author Dmitry A. Soshnikov <[email protected]> |
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
/* | |
asynctask.m -- sample code that shows how to implement asynchronous stdin, stdout & stderr streams for processing data with NSTask | |
compile with: | |
gcc -Wall -O3 -x objective-c -fobjc-exceptions -framework Foundation -o asynctask asynctask.m | |
./asynctask | |
./asynctask > asynctask-output.txt 2>&1 |
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
// Global Object | |
// (§10.2.1) | |
// GO.scope_chain = [GO] | |
// GO._cache = _cache | |
var _cache = {}; | |
// Declaration (§13.2): | |
// CWanonfunc.[[Scope]] = GO.scope_chain.slice(0) (§13.2 step 7) |
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
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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
var detectBackOrForward = function(onBack, onForward) { | |
hashHistory = [window.location.hash]; | |
historyLength = window.history.length; | |
return function() { | |
var hash = window.location.hash, length = window.history.length; | |
if (hashHistory.length && historyLength == length) { | |
if (hashHistory[hashHistory.length - 2] == hash) { | |
hashHistory = hashHistory.slice(0, -1); | |
onBack(); |
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
JSON.stringify(SheetParser.CSS.translate("a a(b), 1px 3em, gradient(from(rgba(1, 1, 1, 3)), to(#ccc)")) | |
"[["a",{"a":"b"}],[{"unit":"px","number":"1"},{"unit":"em","number":"3"}],"gradient",{"from":{"rgba":["1","1","1","3"]}},{"to":"#ccc"}]" |