Skip to content

Instantly share code, notes, and snippets.

@hazisarashi
hazisarashi / ValuesLengthFilter
Created September 26, 2011 09:37
FileMaker カスタム関数 ValuesLengthFilter。値一覧から特定の文字数の値だけを抽出する。
// ValuesLengthFilter ( Values ; Num )
// 値一覧(Values)から、特定(Num)の文字数の値だけを抽出する
Case(
// 初回
ValueCount ( Values );
Let(
[
$$ValuesLengthFilter_Values = Values;
$$ValuesLengthFilter_Num = Num;
tell application "System Events"
tell process 5835
active
end tell
end tell
@hazisarashi
hazisarashi / gist:940279
Created April 25, 2011 08:27
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.10.10
network 192.168.10.0
netmask 255.255.255.0
use utf8;
use warnings;
use strict;
my @a = ( 1, 2 );
my $a = 2;
for(;;){
my $x = $a[$#a] + $a[$#a-1];
last if ( $x >= 4000000 );
push ( @a, $x );
@hazisarashi
hazisarashi / gist:778312
Created January 13, 2011 18:08
Google Image検索を使い、画像がリンク切れしていない物のみを表示する。
<html>
<head>
<title>test imageAjax</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
function getImage( page, keyword ){
this.page = page; // 取得するページ数
<html>
<head>
<style>
div.box{
height:100px;
border:1px solid green;
}
div.spacer{
height:50%;
border:1px solid red;
#!/usr/bin/perl
=head1
二コ生の放送タイトルとかスクレイピングしちゃう簡単なスクリプト
=cut
use strict;
use warnings;
use utf8;
use Encode;
// ==UserScript==
// @name nicoLiveTweet
// @namespace http://nicolivemac.wordpress.com/
// @description ニコ生お知らせTwitterボタン(Web/Mac用Twitterクライアント対応)
// @include http://live.nicovideo.jp/watch/lv*
// @include http://live.nicovideo.jp/editstream/lv*
// ==/UserScript==
/*
放送中にウィンドウを閉じようとすると
# ニコニコ生放送の Twitter ハッシュタグをぶっこ抜く
var livecom = document.getElementsByClassName('livecom')[0];
var onclickString = String( livecom.getElementsByTagName('a')[2].onclick );
var hash = onclickString.match(/%20%23(.+?)'/)[1];
#/usr/bin/perl
use Data::Dumper;
my @list = ( 'Hokkaido', 'Tokyo', 'Yokohama' );
my @newlist = grep{ $_ =~ m#yo#i }@list; # newlistには('Tokyo','Yokohama')が返る
print Dumper @newlist;
#参考:http://bit.ly/akqiI2