Skip to content

Instantly share code, notes, and snippets.

View kanayannet's full-sized avatar

kanayannet kanayannet

View GitHub Profile
Function.prototype.method = function(name, func)
{
this.prototype[name] = func;
return this;
};
String.method('deentityify',function()
Function.prototype.method = function(name,func){
this.prototype[name] = func;
return this;
};
var Mammal = function(name)
{
this.name = name;
};
Mammal.prototype.says = function(){
return this.saying || '';
};
Mammal.prototype.get_name = function()
<html>
<head>
<script language=javascript>
<!--
if(typeof Object.create !== 'function')
{
Object.create = function(o)
{
var F = function(){};
<html>
<head>
<script language=javascript>
<!--
var mammal = function(spec)
{
var that = {};
that.get_name = function()
{
@kanayannet
kanayannet / gist:924002
Created April 17, 2011 12:29
座標取得メモ
var geo = navigator.geolocation;
var watch = geo.watchPosition(function( position )
{
if(position.coords.accuracy < 50)
{
geo.clearWatch(watch);
alert(position.coords.latitude);
alert(position.coords.longitude);
}
},function()
@kanayannet
kanayannet / main_method_list.pl
Created June 21, 2011 03:31
Get main::method list
#!/usr/bin/perl
use strict;
use Devel::Symdump;
my @packs = qw(main);
my $obj = Devel::Symdump->rnew(@packs);
foreach my $func($obj->functions)
{
<html>
<head>
<script language=javascript>
<!--
var by = function(name)
{
return function(o,p)
{
var a,b;
if(typeof o === 'object' && typeof p === 'object' && o && p)
@kanayannet
kanayannet / gist:1082520
Created July 14, 2011 14:10
tkbjs timer
<html>
<head>
<script language=javascript>
<!--
var first_time = new Date();
var flush_color = "#000000";
var max = 120;
var c = 255;
function sabun_get(time)
{
<html>
<head>
<script language=javascript>
<!--
Function.prototype.method = function(name,func)
{
this.prototype[name] = func;
return this;
};