Skip to content

Instantly share code, notes, and snippets.

View UltCombo's full-sized avatar

Fabricio Matte UltCombo

View GitHub Profile
@UltCombo
UltCombo / dabblet.css
Created December 12, 2012 15:27
Untitled
#pokeball {
position:relative;
width: 400px;
height: 400px;
margin:10% auto;
background: #CA0601;
border-radius: 50%;
box-shadow:inset -1px 1px 2px #F74339,
inset -15px 5px 2px #FDE0DF,
inset 0px -115px 2px #CCCDD5;
@UltCombo
UltCombo / dabblet.css
Created December 17, 2012 12:46
clown test only one div - JV
/**
* clown test only one div - JV
*/
body{background: white;}
span{ cursor:none; outline:0; color:white; text-align:center;display:block; width:80px; height:80px; position:relative; top:178px; margin:0 auto; background:transparent; z-index:1;}
div{
width:75px;
@UltCombo
UltCombo / dabblet.css
Created December 18, 2012 19:45
teste transform 3d
/**
* teste transform 3d
*/
#container{
position:relative;
margin:100px auto;
width:200px;
height:200px;
border:solid;
@UltCombo
UltCombo / dabblet.css
Created December 18, 2012 20:42
teste transform 3d
/**
* teste transform 3d
*/
#container{
position:relative;
margin:100px auto;
width:200px;
height:200px;
transform:perspective(500);
@UltCombo
UltCombo / gist:5350767
Last active December 16, 2015 00:49
XOR checkbox checked state toggler
<input type="checkbox"><button>Clique para alternar estado do checkbox</button>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$('button').click(function() {
$('input')[0].checked ^= 1;
});
</script>
$('input')[0].checked ^= 1; //referência à prop checked do elemento input
inputElRef.checked = false ^ 1; //conversão implícita ToNumber
inputElRef.checked = 0 ^ 1; //bits diferentes, XOR retorna 1
inputElRef.checked = 1; //conversão implícita ToBoolean
inputElRef.checked = true;
[] == false //ToPrimitive deste array retorna string vazia
"" == false //comparação com boolean converte booleano ToNumber
"" == 0 //comparação de string com número converte string ToNumber
0 == 0
true
>>> 1 == true
<<< true
>>> 0 == false
<<< true
<<< +true
>>> 1
<<< +false
<<< 0
>>> !!1
<<< true
>>> !!0
<<< false
@UltCombo
UltCombo / gist:5359288
Created April 10, 2013 23:16
XOR truth table
^ | 0 1
--+-----
0 | 0 1
1 | 1 0