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/local/bin/ruby | |
require 'net/http' | |
require 'rss' | |
require 'time' | |
require 'lib/simple_cgi.rb' | |
print "Content-Type:text/html\n\n" | |
query = SimpleCGI::query |
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
require 'rss' | |
require 'net/http' | |
require 'uri' | |
require 'time' | |
Net::HTTP.version_1_2 | |
class RSSReader | |
@@http = Net::HTTP |
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
javascript:(function(){ | |
var _d = document; | |
var array = _d.body.innerHTML.match(/("|')([^"']+?\.)(jpg|gif|png|bmp|jpeg)("|')/ig); | |
if(!array) | |
return alert('見つからなかった。'); | |
var exist = {}; | |
for(var i=0; i < array.length; i++) { | |
if(!exist[array[i]]) { | |
_d.write('<img src=' + array[i] + '>'); | |
exist[array[i]] = 1 |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
void encode(char *target, char *str) { | |
char *result = malloc(strlen(target) * 8 + 1); | |
if(result) { | |
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
function parseObject(obj) { | |
var _d = document, create = function(element) {return _d.createElement(element)} | |
switch(obj.constructor) { | |
case Array: | |
var list = create('ul'); | |
break | |
case Object: | |
var list = create('dl'); | |
break | |
default: |
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
//配列にindexOfが使えるブラウザ(IE以外)ではこんな回りくどいことをしなくてもいい。 | |
function dontOverWrap(array) { | |
var r = '', arr = []; | |
for(var i = 0; i < array.length; i++) { | |
if(r.indexOf(',' + array[i] + ',') === -1) { | |
r += ',' + array[i] + ','; | |
arr[arr.length] = array[i] | |
} | |
} | |
return arr |
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
var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
var skype = new ActiveXObject("Skype4COM.Skype"); | |
var wss = new ActiveXObject("WScript.Shell"); | |
function Skype_MessageStatus(msg, status) { | |
var topic = "log/" + (msg.chat.Topic || "個人チャ"); | |
if(!fso.FolderExists(topic)) | |
fso.CreateFolder(topic); | |
if(status == skype.Convert.TextToChatMessageStatus("RECEIVED") || | |
status == skype.Convert.TextToChatMessageStatus("SENT")) { |
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
function addPropertyToElement(element, property) { //property format is object . {'foo' : 'bar'} | |
for(var i in property) | |
element.style[i] = property[i]; | |
} | |
onload = function() { | |
addPropertyToElement(document.getElementsByTagName('h1')[0], { | |
'color' : 'red', | |
'fontSize' : '50px', | |
'border' : '1px solid black', |
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
function a(b){ | |
alert(b) | |
} | |
Object.prototype.send = function(method, args) { | |
var args = args instanceof Array ? args : [args] | |
return this[method].apply(this, args) | |
} | |
function send(func, args) { | |
var func = /\./.test(func) ? func.split(".") : func; | |
var args = args instanceof Array ? args : [args] |
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; | |
print "hello world" |
OlderNewer