Skip to content

Instantly share code, notes, and snippets.

View acotie's full-sized avatar

Akiko Yokoyama acotie

View GitHub Profile
<cffunction name="QueryToStructArray" access="private" returntype="array" output="no" hint="convert to Array of query to Struct.">
<cfargument name="query" type="query" required="yes">
<cfargument name="rownum" type="numeric" default="1">
<cfset var local = StructNew()>
<cfset local.result = ArrayNew(1)>
<cfif arguments.query.RecordCount gte 1>
<cfloop index="local.i" from="1" to="#arguments.query.RecordCount#">
<mx:Script>
<![CDATA[
import flash.net.*;
public function openNewWindow(event:MouseEvent):void {
var u:URLRequest = new URLRequest("http://www.adobe.com/flex");
navigateToURL(u,"_self");
}
]]>
</mx:Script>
<cffunction name="QueryToStruct" access="private" returntype="struct" output="no" hint="I convert a row of a query to a struct.">
<cfargument name="query" type="query" required="yes">
<cfargument name="rownum" type="numeric" default="1">
<cfset var result = StructNew()>
<cfloop index="col" list="#query.ColumnList#">
<cfset result[col] = query[col][rownum]>
</cfloop>
if has("gui_running")
set fuoptions=maxvert,maxhorz
au GUIEnter * set fullscreen
endif
if has('gui_macvim')
set showtabline=2 " タブを常に表示
set imdisable " IMを無効化
set transparency=10 " 透明度を指定
set antialias
set guifont=Monaco:h14
colorscheme macvim
endif
@acotie
acotie / component.mxml
Created January 12, 2010 15:50
component sample : ./components/comp1.mxml ...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" styleName="plain" layout="absolute" xmlns:components="components.*"
width="829" height="529" pageTitle="Flex Basicサンプル:カスタムMXMLコンポーネント(MXML Components)">
<components:comp1 id="comp1" y="51" dispString="{comp2.textinput1.text}" />
<components:comp2 id="comp2" x="408" y="51" />
<mx:ApplicationControlBar x="10" y="0" width="100%">
<mx:Label text="メインアプリケーション" fontSize="16" />
</mx:ApplicationControlBar>
@acotie
acotie / itemrenderer.mxml
Created January 12, 2010 15:49
DadaGrid sample : data/data.xml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" styleName="plain" pageTitle="Flex Basicサンプル: ドロップインアイテムレンダラー/アイテムエディタ" creationComplete="getPersonData.send()">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import mx.containers.*;
[Bindable]
private var personList:ArrayCollection;
]]>
@acotie
acotie / event.mxml
Created January 12, 2010 15:48
easy event
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button click="mx.controls.Alert.show('ボタンが押されました')" x="176.5" y="177" label="hello"/>
</mx:Application>
@acotie
acotie / binding.mxml
Created January 12, 2010 15:47
binding sample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Label x="10" y="10" text="バインディングを確認するサンプル" fontWeight="bold" fontSize="12" />
<mx:TextInput x="126" y="50" id="input_text" width="254" />
<mx:Label x="10" y="52" text="文字を入力して下さい:" />
<mx:Label x="10" y="104" text="バインディングによる表示:" />
<mx:Label x="137" y="196" width="275" text="{input_text.text}" />
<mx:Label x="126" y="196" width="275" id="output_lbl" />
<mx:Button x="10" y="194" label="値をコピー" width="100" click="output_lbl.text = input_text.text;" />
#!/us/bin/perl
use strict;
use Web::Scraper;
use URI;
use Net::Twitter;
use YAML;
my $uri = URI->new("http://www.fujitv.co.jp/meza/uranai/");
my $scraper = scraper {