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
<% form_for @search do |f| %> | |
<ul> | |
<li> | |
<%= f.label :name_like, "Name" %> | |
<%= f.text_field :name_like %> | |
</li> | |
<li> | |
<%= f.label :category_id_equals, "Category" %> | |
<%= f.collection_select :category_id_equals, Category.all, :id, :name, :include_blank => true %> | |
</li> |
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
<div id="fb_chart" style="width: 100%; height: 300px;"></div> | |
<% content_for :javascripts do %> | |
<script type="text/javascript"> | |
new Highcharts.Chart({ | |
chart: { renderTo: 'fb_chart', defaultSeriesType: 'area' }, | |
title: { text: 'Facebook Publish to Token Rate per Day' }, |
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
@TortugaTable(tableName = "users") | |
@DatabaseTable(tableName = "users") | |
public class User { | |
@DatabaseField(canBeNull = false) | |
@TortugaField(canBeNull = false) | |
private String username; | |
@DatabaseField(canBeNull = false) | |
@TortugaField(canBeNull = false) |
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
/* | |
* TortugaTable.java | |
* | |
* This is the Annotation class. | |
* | |
*/ | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface TortugaTable { | |
String tableName(); | |
} |
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
@DualORM(tableName = "users") | |
public class User { | |
// LOCAL ONLY | |
@DualORMField(remote = false) | |
private String fontColor; | |
// LOCAL AND REMOTE ONLY | |
@DualORMField(canBeNull = false) | |
private String username; |
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
####### Annotation | |
[sun-2:Tortuga] cat src/TortugaTable.java | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface TortugaTable { | |
String tableName(); | |
} |
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
ClasspathScanner scanner = new ClasspathScanner(); | |
Set<Class<?>> classes = scanner.getClasses(new ClassQuery() { | |
protected void query() { | |
select(). | |
from("com.elc.tasklist"). | |
returning(allImplementing(TortugaTable.class)); | |
} | |
}); |
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
"" Strip all trailing whitespace in file | |
"" http://vim.wikia.com/wiki/Remove_unwanted_spaces | |
function! StripWhitespace () | |
exec ':%s/ \+$//gc' | |
endfunction | |
map ,s :call StripWhitespace ()<CR> | |
autocmd BufWritePre * :%s/\s\+$//e |
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
filetype off | |
call pathogen#runtime_append_all_bundles() |
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
iOS | |
----------------------------------- | |
@interface Product : MaaSModel { | |
NSString *_name; | |
NSInteger *_quantity; | |
} | |
Android | |
----------------------------------- |