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
| // Author: pmint93 | |
| function run(virtual_host, mask, auth){ | |
| var trs = $('.updatable table.list tbody tr'); | |
| var queues = trs.each(function(i, v){ | |
| var name = $(v).find('td').eq(1).text(); | |
| console.log(name); | |
| if(name.match(mask)){ | |
| $.ajax({ | |
| method: 'GET', |
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
| def run | |
| n = 1_000 | |
| id = User.first.id | |
| display_name = User.only(:display_name).find(id).display_name | |
| Benchmark.bm(50) do |x| | |
| x.report('User.find(id).display_name') do | |
| n.times{ User.find(id).display_name } | |
| 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
| # Author: pmint93 | |
| # Exercise: https://www.facebook.com/groups/718037468264021/permalink/765003373567430/ | |
| class Greeter | |
| def self.hello(file = '') | |
| yield if defined? yield | |
| eval open(file).read if File.exist? file | |
| end | |
| end |
NewerOlder