This file contains hidden or 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
function reset_colors(map) { | |
var layer = map.featureLayer, | |
geoJson = layer.getGeoJSON(), | |
features = geoJson.features; | |
for (var i = 0; i < features.length; i++) { | |
features[i].properties['marker-color'] = "#0F86BD"; | |
} | |
layer.setGeoJSON(geoJson); | |
} |
This file contains hidden or 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
// get text for element without children text | |
var article_title_in_cn = $this.clone().children().remove().end().text().trim(); |
This file contains hidden or 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
Article.joins(:tags).where(tags: {id: tag_ids_arr}).order("articles.updated_at DESC").pluck(:id).uniq |
This file contains hidden or 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
= I18n.backend.translate("zh-TW", "tags.#{tag_of_like_article.tag_type}") |
This file contains hidden or 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
a.sort # sort by asc | |
a.sort { |x,y| y <=> x } # sort by desc |
This file contains hidden or 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
#create capistrano task to run rake task of rails | |
# add below code to deploy.rb | |
desc "recreate version of all images." | |
task :recreate_version_of_images do | |
on roles(:app) do | |
within "#{current_path}" do | |
with rails_env: :production do | |
execute :rake, "images:recreate_version" | |
end | |
end |
This file contains hidden or 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
Image.where("image is not ?", nil).each do |image| image.image.recreate_versions! if image.image? end |
This file contains hidden or 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
params.require(:article).permit(:title, :content, :description, :images_attributes => [:title, :image]) |
This file contains hidden or 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
# return boolean but not MatchData | |
!!website.match(Regexp.new(sites)) |
This file contains hidden or 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
TODO List | |
2014-10-12 13:04:37 ---------------------------------------- | |
[_] 50% About vimoutliner | |
[X] Learn vimoutliner | |
[_] Content code issue of vimoutliner when use otl2html.py | |
NEXT ACTIONS | |
[_] 16%Lenrn rails | |
[X] Try swaggerui gem | |
[_] Learn docker-http://blog.gemnasium.com/post/65599561888/rails-meets-docker | |
[_] Learn chef http://learn.getchef.com/ |
OlderNewer