- Setting breakpoint
- Request http://127.0.0.1:8000/xxxx?XDEBUG_SESSION_START=yyyy
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
| #!/usr/bin/env ruby | |
| class Model | |
| attr_accessor :genomes | |
| def initialize(genomes) | |
| @genomes = genomes | |
| end | |
| def score |
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
| #!/usr/bin/env ruby | |
| class Model | |
| attr_accessor :a, :b, :c, :d, :e, :f, :g, :h | |
| def attributes(arr) | |
| @a = arr[0] | |
| @b = arr[1] | |
| @c = arr[2] | |
| @d = arr[3] |
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
| #!/bin/bash | |
| PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
| SSH=33843 | |
| HTTP=80,443 | |
| IDENT=113 | |
| NTP=123 | |
| MYSQL=3306 | |
| DHCP=67,68 | |
| initialize() |
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 'benchmark' | |
| n = %w(a b c d e f g h i j k l m n o p q r s t u v w x y z) | |
| Benchmark.bm do |bm| | |
| bm.report("each_with_index:") { | |
| 100000.times do | |
| n.each_with_index do |o,i| | |
| x = [o, i] | |
| 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
| <script type="text/javascript"> | |
| //<![CDATA[ | |
| $(function(){ | |
| $("body a[href^='http://']").on("click", function(){ | |
| url = $(this).attr('href'); | |
| if(url.indexOf($(location).attr('hostname')) == -1) | |
| { | |
| _gaq.push(['_trackEvent', 'Link', $(location).attr('href'), url]); | |
| } | |
| }); |
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
| # In your config/initializers/active_enum.rb | |
| # @see https://github.com/adzap/active_enum/pull/4 | |
| # @example | |
| # * ja.yml | |
| # active_enum: | |
| # user: | |
| # sex: | |
| # male: '男性' | |
| # female: '女性' | |
| # * user.rb |
NewerOlder