Skip to content

Instantly share code, notes, and snippets.

View irae's full-sized avatar

Irae Carvalho irae

View GitHub Profile
// ==UserScript==
// @name Inventário do brute
// @namespace La e My Brute
// @description Adiciona a opção de visualizar o inventário do adversário na arena
// @include http://*.labrute.com/arene
// @include http://*.mybrute.com/arene
// ==/UserScript==
// Add jQuery
var GM_JQ = document.createElement('script');
// jQuery('#myId').scrollToMe();
jQuery.fn.scrollToMe = function(speed,callFunc) {
var that = this;
setTimeout(function() {
var targetOffset = that.offset().top-10;
$('html,body').eq(0).animate({scrollTop: targetOffset}, speed || 500, callFunc);
},500);
return this;
};
#!/bin/bash
## script to connect to indecent webdav implementations using wdfs
## on macosx with macfuse
## user config
user="o_seu"
pass="aprils_fools"
mount_to="/Remote/"
@irae
irae / gist:370058
Created April 18, 2010 07:03 — forked from remy/gist:368657
function addEvent(el, type, fn) {
el.addEventListener(type, fn, false);
return function (type, fn) {
return addEvent(el, type, fn);
};
}
// So I can do this:
addEvent(document.getElementsByTagName('img')[0], 'dragend', logEvent)('dragstart', logEvent);
// Some simple functions to find elements.
var id = function(id){return document.getElementById(id)},
tag = function(tag,scope){return (scope||document).getElementsByTagName(tag)},
hasClass = function(find,nodes) {
var ret = [],node,i; for(i=0;i<nodes.length;i++) { node = nodes[i];
if(1+node.className.indexOf(find)) { ret.push(node);}
} return ret;
};
// usage
// markup:
// <div class="container">
// <div class="inner"></div>
// </div>
// caso que você já tem div.container e quer pegar todos os div.inner
$('div.container').find('div.inner').each(function(){
$(this) // cada iteração vai passar por uma div.inner
});
// handle filters with only one event
$('#filters').delegate(':radio','change', function(){
var active = $('#filters :radio:checked').val();
$('#stickers')
.removeClass()
.addClass('filter-'+active);
});
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
<script type="text/javascript">
(function(){
// Fix IE problem with many span inside an <a> and fix hovering
if(document.body.attachEvent){
function findLink(elm) {
if(elm.nodeName.toLowerCase() == "a") {
return elm;
} else {
return findLink(elm.parentNode);
}
@irae
irae / gist:708294
Created November 21, 2010 00:02
The better way to clearfix ever!
/* The Magnificent CLEARFIX: Updated to prevent margin-collapsing on child elements << j.mp/bestclearfix */
/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
/* Note: It's better to use display:inline-block; if width is set on the element you want to clear */
.clearfix:before, .clearfix:after {
content: "\0020"; display: block; height: 0; visibility: hidden;
}
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }