This file contains 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> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>CSSPrimitiveValue & RGBColor</title> | |
</head> | |
<body> | |
<div id="panel1" style="background-color:#09c;"> test</div> | |
</body> | |
<script> |
This file contains 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
/* Checkbox Hack */ | |
input[type=checkbox] { | |
position: absolute; | |
top: -9999px; | |
left: -9999px; | |
} | |
label { | |
-webkit-appearance: push-button; | |
-moz-appearance: button; |
This file contains 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
# zip | |
zip -r test.zip .vim .vimrc | |
unzip -l test.zip | |
zip -d test.zip filename_to_delete | |
zip -e test.zip path_to_file | |
zip -er test.zip path_to_folder | |
# rar | |
rar a test.rar .emacs.d .emacs | |
unrar x test.rar |
This file contains 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
from decimal import Decimal | |
print 1/Decimal(998001) |
This file contains 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
/** | |
* Typing animation with pure CSS | |
* Revised. Browser support (as of Feb 2012): Firefox, IE10 | |
*/ | |
@keyframes typing { from { width: 0; } } | |
@keyframes blink-caret { 50% { border-color: transparent; } } | |
h1 { | |
font: bold 200% Consolas, Monaco, monospace; |
This file contains 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
/** | |
* Move in a circle without wrapper elements | |
* Idea by Aryeh Gregor, simplified by Lea Verou | |
*/ | |
@keyframes rot { | |
from { | |
transform: rotate(0deg) | |
translate(-150px) | |
rotate(0deg); |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def get_image_type(filename): | |
with open(filename, 'rb') as f: | |
data = f.read(10).encode('hex') | |
ftype = None | |
if data.startswith('ffd8'): | |
ftype = 'jpeg' | |
elif data.startswith('474946'): |
This file contains 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
/** | |
* Flexible multiline definition lists with 2 lines of CSS | |
*/ | |
dt, dd { display: inline; margin: 0; } | |
dd:after { | |
content: '\A'; | |
white-space: pre; | |
} |
This file contains 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> | |
#define A(x) x;x;x;x;x;x;x;x;x;x; | |
int main (void) | |
{ | |
int n = 1; | |
A(A(A(printf ("%d ", n++)))); | |
return 0; | |
} |
This file contains 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
/** | |
* Checkable star | |
*/ | |
.checkable-star { display: none; } | |
.checkable-star + label { padding: 1px 8px; cursor: pointer; background: url(http://uedsky.com/images/res/star-icons.png) no-repeat; } | |
.checkable-star + label:hover { background-position: -16px 0; } | |
.checkable-star:checked + label { background-position: -32px 0; } |