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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 perl | |
use strict; | |
use warnings; | |
use Mac::iTunes::Library; | |
use Mac::iTunes::Library::XML; | |
my $library = Mac::iTunes::Library::XML->parse( 'iTunes Library.xml' ); | |
my $count=0; | |
my %items = $library->items(); |
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
$ guid.exe | |
4b1d4ca7f22b49e284753a034e673629 |
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
#!/bin/bash | |
# http://blog.indonesiancoder.com/google-gears-wifi-geolocation-api-query | |
# http://www.guilz.org/2011/11/28/google位置情報サービスから住所を取得する/ | |
if [ $# != 2 ]; then | |
echo "# Google Gears WiFi Geolocation API query by ShadowHat=esYou" | |
echo "# Shadow@SquatThis.net" | |
echo "#" | |
echo "# Use: $0 MAC1 MAC2" |
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
dt = new Date(); | |
y = dt.getYear() + 1900; | |
m = dt.getMonth() + 1; | |
document.write("<table>"); | |
document.write("<tr><td align=center colspan=7>"); | |
document.write(y + "/"); | |
if (m < 10) { document.write(" "); } | |
document.write(m); | |
document.write("</td></tr>"); |
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
;;======================================================================= | |
;; @ wp-emacs(weblogger) | |
;;======================================================================= | |
(require 'weblogger) | |
(global-set-key "\C-c\C-w" 'weblogger-start-entry) ; weblogger起動(C-c C-w) | |
(defun my-weblogger-send-entry (&optional arg) | |
(interactive) | |
(save-buffer) | |
(set-buffer-modified-p t) |
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/perl | |
use strict; | |
use warnings; | |
use Web::Scraper; | |
use URI; | |
use Encode; | |
my $word = $ARGV[0] ? decode('utf-8', $ARGV[0]) : "weezer"; | |
my $uri = create_uri($word); |
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
use strict; | |
# 配列 | |
my @array = ('dog', 'pochi', 2); | |
print $array[1] . "\n"; # pochi | |
# 無名配列(Anonymous Array) | |
my $array_ref = ['dog', 'pochi', 2]; | |
print $array_ref->[1] . "\n"; # pochi |
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
package Class; | |
use base qw(Class::Accessor); | |
__PACKAGE__->mk_accessors(qw(X Y)); | |
1; | |
package Main; | |
my $o = Class->new({X => 20}); | |
print $o->X() . "/" . $o->Y() . "\n"; # 20/ | |
$o = Class->new({X => 40, Y => 50}); |
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
sub input_password() { | |
my $pass; | |
while (!$pass) { | |
print "Password --> "; | |
system "stty -echo"; | |
chomp($pass = <STDIN>); | |
print "\n"; | |
system "stty echo"; | |
} |
NewerOlder