Skip to content

Instantly share code, notes, and snippets.

View ryan5500's full-sized avatar

Tomoaki Sano ryan5500

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.rightClick.js"></script>
<script type="text/javascript">
$(function() {
$('#content').offset({top: $('#view_window').width() / 2, left: $('#view_window').height() / 2});
$('#view_window').click(function(event) {
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="jquery.rightClick.js"></script>
<script type="text/javascript">
$(function() {
var zoom_ratio = 1;
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.rightClick.js"></script>
<script type="text/javascript">
$(function() {
var zoom_ratio = 1;
//set original coords
@ryan5500
ryan5500 / drop_test.html
Created April 20, 2010 19:36
jquery-ui droppable bug
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="drop_test.js"></script>
<style>
#ans_container {
width: 400px;
height: 400px;
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript'>
//which is called early, ajaxStop or load?
$(function() {
$('#log').ajaxStop(function() {
$(this).text('trigger ajaxStop');
alert($('#result').text()); //this method is later
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript'>
$(function() {
alert($('div').filter('.hide').text());
alert($('div').find('.hide').text());
});
</script>
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript'>
$(function() {
//invoke here when dom is ready
alert($('#main').text());
});
</script>
for each(var o:* in sprite.getChildren()) {
if(o as MyClass) {
trace('here!');
}
}
use strict;
use GD::Graph::bars;
use Path::Class qw(dir);
my $dir = dir('.');
my $handle = $dir->open;
while (my $file = $handle->read) {
next unless $_ =‾ /log$/;
package MatchScraper;
use strict;
use warnings;
use LWP::Simple;
use HTML::TreeBuilder::XPath;
my $tree = HTML::TreeBuilder::XPath->new;
sub scrape {
my $url = shift;