Skip to content

Instantly share code, notes, and snippets.

#file ".gitignore", <<-END
#.DS_Store
#log/*.log
#tmp/**/*
#config/database.yml
#db/*.sqlite3
#END
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run "cp config/database.yml config/example_database.yml"
#mount a folder
mount --bind temp tmp
var startDate:Date=new Date();
startDate.setTime(startDate.getTime() - 6 * 24 * 3600 * 1000);
1. javascript error: line 2, char 1
missed js file
<mx:Style>
.gradientBackground { borderStyle: applicationControlBar; fillColors: #EEEEFF, #8888AA; fillAlphas: 0.7, 0.7; highlightAlphas: 0, 0; }
</mx:Style>
<mx:VBox styleName=”gradientBackground” width=”300″ height=”300″ />
encodeURI:
UrlParam = UrlParam + '&name=' + encodeURIComponent(name.text) +
'&business=' + encodeURIComponent(buisness.text);
navigateToURL(new URLRequest(UrlParams),'_self');
//bindable getter
[Bindable(event='imageStatusChanged')]
public function get status():String
{
return _status;
}
public function set status(s:String):void
{
__status = s;
this.dispatchEvent(new Event('imageStatusChanged'));
>> s = "One\nTwo\nThree\nFour\n"
=> "One\nTwo\nThree\nFour\n"
>> s.to_a[2..-1].join
=> "Three\nFour\n"
#delete the first 2 lines.
require 'net/http'
require 'rexml/document'
# Web search for "madonna"
url = 'http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=madonna&results=2'
# get the XML data as a string
xml_data = Net::HTTP.get_response(URI.parse(url)).body
# extract event information
# h = [["a", 100], ["c", 300], ["d", 400]] 怎么转化成 {"c" => 300, "a" => 100, "d" => 400, "c" => 300 }这样一个hash
h.flatten!
Hash[*h]
@rockydd
rockydd / gist:825433
Created February 14, 2011 03:12
pie chart sample. with showDataEffect
<mx:PieChart x="92" y="200" id="pieTeamEffort" dataProvider="{teamEffort}" showDataTips="true">
<mx:series>
<mx:PieSeries displayName="Effort" field="effort" nameField="name">
<mx:showDataEffect>
<mx:SeriesInterpolate duration="1000"/>
</mx:showDataEffect>
</mx:PieSeries>
</mx:series>
</mx:PieChart>