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
$('#banDateOneReal').data("DateTimePicker").destroy(); | |
http://stackoverflow.com/questions/22957699/how-to-change-a-bootstrap-datetimepicker-language-during-running |
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
.endmost is what you want when you call .last: the last N records in the result set without having to retrieve all records from the database, and it works with any ordering. You can impose filtering before, Message.where(…).in_order.endmost(10), and afterwards to filter your final results as well Message.in_order.endmost(10).where(…). | |
class Message | |
class << self | |
def in_order | |
order(created_at: :asc) | |
end | |
def recent(n) | |
in_order.endmost(n) |
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
http://live.datatables.net/IroN/399/edit |
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
Cms::Content.collection.aggregate([{"$group" => {"_id" => "$key", "count" => {"$sum" => 1}}}, {"$match" => {"count" => {"$gt" => 1}}}, {"$sort" => {"count" => -1}}]) |
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
188,139,85,078,41,251,234,35,275,136,014,270,179,46,89,172,052,207,192,55,205,42,133,26,37,71,083,153,97,142,197,134,159,109,162,79,184,101,4,169,196,185,195,59,103,204,170,22,247,24,144,036,21,80,065,149,217,3,222,104,60,232,64,224,44,161,231,094,230 |
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
# Add some methods to IRB::Context and IRB::Irb | |
# for easier timeout implementation. | |
class IRB::Irb | |
def status | |
@signal_status | |
end | |
end | |
class IRB::Context | |
attr_reader :irb |
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
https://www.youtube.com/watch?v=kZcqyuPeDao | |
https://gist.github.com/nateberkopec/2b1f585046adad9a55e7058c941d3850 | |
https://www.speedshop.co/2015/07/15/the-complete-guide-to-rails-caching.html | |
https://www.railsspeed.com/ | |
https://www.speedshop.co/2015/07/29/scaling-ruby-apps-to-1000-rpm.html | |
https://www.speedshop.co/2015/10/07/frontend-performance-chrome-timeline.html | |
https://github.com/ruby-prof/ruby-prof | |
https://github.com/schneems/get_process_mem | |
https://github.com/ko1/allocation_tracer | |
https://github.com/evanphx/benchmark-ips |
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
http://www.sm-cloud.com/ruby-json-mapping/ | |
http://jsonapi-rb.org/#rails | |
https://github.com/trailblazer/representable | |
https://github.com/trailblazer/roar | |
https://github.com/remiprev/her | |
https://github.com/lostisland/faraday_middleware/wiki | |
http://blog.excelwithcode.com/ruby-api-clients.html |
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
dis,5,108.59 | |
nflx,3,130.91 |
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
require 'objspace' | |
require 'benchmark' | |
Benchmark.bmbm do |bm| | |
bm.report("using [] :") do | |
GC.start | |
mem_before = ObjectSpace.memsize_of_all | |
before = GC.stat[:total_allocated_objects] | |