Skip to content

Instantly share code, notes, and snippets.

@xem
xem / dabblet.css
Created February 27, 2012 16:01
Y U NO ?
/* Y U NO ? */
body { background: #13579B; }
.outer1 { width: 100px; height: 100px; margin: 100px auto; }
.inner1 { width: 100%; height: 100%; text-align: center; background: #FEDCBA; transition: all 1s ease; }
.outer1:hover { position: absolute; top: 0; left: 0; }
.outer2 { width: 100px; height: 100px; position: relative; margin: 100px auto; }
.outer2:hover { position: static; }
@xem
xem / LICENSE.txt
Created September 26, 2012 18:39 — forked from 140bytes/LICENSE.txt
Enhanced binary operations: left shift, right shift, and a bonus: bit extraction
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 MAXIME EUZIERE
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.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@xem
xem / dabblet.css
Created December 14, 2012 09:53
Untitled
.square { width: 100px; height: 100px; border: 1px solid black; }
@xem
xem / LICENSE.txt
Last active December 14, 2015 08:38 — forked from 140bytes/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@xem
xem / dabblet.css
Created April 5, 2013 12:08
vertical margins and paddings depend on the parent's width.
/* vertical margins and paddings depend on the parent's width. */
div.out {
width: 800px;
height: 400px;
overflow: hidden;
background: #abc;
}
div.in {
@xem
xem / dabblet.css
Created April 5, 2013 12:58
vertical margins and paddings depend on the parent's width. Are there other CSS properties that do the same?
/* vertical margins and paddings depend on the parent's width. Are there other CSS properties that do the same? */
div.out {
width: 800px;
height: 400px;
overflow: hidden;
background: #abc;
}
div.in {
@xem
xem / LICENSE.txt
Last active December 16, 2015 17:40 — forked from 140bytes/LICENSE.txt
CSS mini minifier 0.6
WTFPL
@xem
xem / LICENSE.txt
Last active December 16, 2015 18:19 — forked from 140bytes/LICENSE.txt
CSS mini minifier 0.7
WTFPL
@xem
xem / moz.xml
Created December 23, 2015 16:56
moz-binding
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="mycode">
<implementation>
<constructor>
alert("XBL script executed.");
</constructor>
</implementation>
</binding>
@xem
xem / gist:6809574
Last active December 24, 2015 13:59

document.getelementById can be omitted in all major browsers, inclunding IE6+. This is non-standard, but all of them save the elements ids as globals.

<div id="myId"></div>
<script>
  alert(myId.id);         // --> myId
  alert(window.myId.id);  // --> myId
</script>