Skip to content

Instantly share code, notes, and snippets.

View yanguango's full-sized avatar
🚀
Launching

Guang Yang yanguango

🚀
Launching
View GitHub Profile
@yanguango
yanguango / Gemfile
Created December 10, 2015 17:29
Flat Array
source 'https://rubygems.org'
group :test do
gem 'minitest'
end
public class RefreshService extends Service {
public void refreshTimeline() {
//build the intent with new messages
this.sendOrderedBroadcast(intent, null);
}
}
public class TimelineActivity {
private RefreshTimelineReceiver refreshReceiver;
public void onResume() {
super.onResume();
IntentFilter filter = new IntentFilter(RefreshService.REFRESH_TIMELINE);
refreshReceiver = new RefreshTimelineReceiver();
registerReceiver(refreshReceiver, filter);
}
public class RefreshService extends Service {
public void refreshTimeline() {
//build the intent with new messages
sendBroadcast(intent);
}
}
public class MyApplication extends Application {
private static MyApplication singleton;
public static MyApplication getInstance(){
return singleton;
}
@Override
public void onCreate() {
super.onCreate();
singleton = this;
MyApplication mApplication = (MyApplication)getApplicationContext();
String username = mApplication.getUsername();
String password = mApplication.getPassword();
public class MyApplication extends Application {
private SharedPreferences mPrefs;
@Override
public void onCreate() {
super.onCreate();
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
}
public String getUsername(){
<application android:icon="@drawable/icon" android:label="@string/app_name" android:name="MyApplication">
mac-mini:newsite bl0ck$ ruby script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
config.gem: Unpacked gem authlogic-2.1.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
=> Call with -d to detach
=> Ctrl-C to shutdown server
Wed Jan 26 20:28:25 +0800 2011: Read error: #<LoadError: Expected /Library/Ruby/Gems/1.8/gems/unindentable-0.1.0/lib/unindentable.rb to define Unindentable>
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:426:in `load_missing_constant'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;