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
| class AsyncMethodJob < ApplicationJob | |
| queue_as :default | |
| def perform(target:, method_name:, args:, queue_name: :default) | |
| self.class.queue_as(queue_name) | |
| # `target` could be either an instance or a class | |
| target = target.constantize if target.is_a?(String) # Convert class name to class object if needed | |
| target.send(method_name, *args) | |
| 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
| class AsyncMethodJob < ApplicationJob | |
| queue_as :default | |
| def perform(target:, method_name:, args:, queue_name: :default) | |
| self.class.queue_as(queue_name) | |
| # `target` could be either an instance or a class | |
| target = target.constantize if target.is_a?(String) # Convert class name to class object if needed | |
| target.send(method_name, *args) | |
| 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
| Homebrew build logs for qt5 on Mac OS X 10.12 | |
| Build date: 2016-09-14 08:01:12 |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- | |
| ◯ | |
| Theme by inky. | |
| Inspired by 'Minimalist', one of the default Tumblr themes. | |
| --> |
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
| apt-get -y update | |
| apt-get -y build-dep build-essential | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libffi-dev libxslt1-dev libxml2-dev | |
| cd /tmp | |
| curl -s -L http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xzv | |
| cd `ls | grep -m 1 ruby-` | |
| ./configure --prefix=/usr/local --disable-install-rdoc | |
| make | |
| make install |
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
| # See http://m.onkey.org/running-rails-performance-tests-on-real-data | |
| # START : HAX HAX HAX | |
| # Load Rails environment in 'test' mode | |
| RAILS_ENV = "test" | |
| require File.expand_path('../../config/environment', __FILE__) | |
| # Re-establish db connection for 'performance' mode | |
| silence_warnings { RAILS_ENV = "performance" } | |
| ActiveRecord::Base.establish_connection |
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
| /* | |
| * CodePress regular expressions for HTML syntax highlighting | |
| */ | |
| // HTML | |
| Language.syntax = [ | |
| { input : /(<[^!]*?>)/g, output : '<b>$1</b>' }, // all tags | |
| { input : /(<a .*?>|<\/a>)/g, output : '<a>$1</a>' }, // links | |
| { input : /(<img .*?>)/g, output : '<big>$1</big>' }, // images | |
| { input : /(<\/?(button|textarea|form|input|select|option|label).*?>)/g, output : '<u>$1</u>' }, // forms |
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
| <div class="primary_fields"> | |
| {{ form.list }} | |
| {{ form.name }} | |
| {{ form.description }} | |
| {{ form.url }} | |
| </div> | |
| # etc | |
| And each of the form.fieldname lines (whatever the markup would be) would be doing something like this, but maybe with real code instead of the template language: |
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
| require 'abstract_unit' | |
| require 'benchmark' | |
| class MemcacheClientTest < Test::Unit::TestCase | |
| def setup | |
| @cache_store = ActiveSupport::Cache.lookup_store(:mem_cache_store, "127.0.0.1:11211", "localhost:11211") | |
| @cache_store_no_timeouts = ActiveSupport::Cache.lookup_store(:mem_cache_store,"127.0.0.1:11211", "localhost:11211",{ :timeout => nil }) | |
| @test_string = "A short string, but not too short; an average-length string, let's say. Just a little more length. Ok, now we're about right." | |
| @test_string_2 = "73f382c327d2fb5809f383fca29b1fa8a9931b3d316836ad8598cdb1f7105a4d98296238a451122b340259ffb0b9b5e517d8d315244fe917e3a114c5d5a367f3" |
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
| testing ActiveSupport::Cache with different versions of memcache_client: | |
| see test in http://gist.github.com/94481 | |
| memcache_client version: 1.5.0 | |
| 7.610000 0.510000 8.120000 ( 9.603848) | |
| memcache_client version: 1.5.0.1 | |
| 8.010000 0.490000 8.500000 ( 9.738587) | |
| memcache_client version: 1.5.0.5 |
NewerOlder