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
| // clang++ -Wall -pedantic -std=c++11 -stdlib=libc++ bind.cpp | |
| #include <iostream> | |
| #include <functional> | |
| using std::cout; | |
| using std::endl; | |
| using std::bind; | |
| using std::placeholders::_1; | |
| using std::placeholders::_2; |
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 'bacon' | |
| require 'rubyqc' | |
| Bacon.summary_on_exit | |
| Bacon::Context.include RubyQC::API | |
| class User < Struct.new(:name, :gold) | |
| def self.rubyqc | |
| new(String.rubyqc, (0..99).rubyqc) |
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
| autocmd FileType vimfiler nmap <buffer> <enter> ToggleOrEnter() | |
| function! ToggleOrEnter() | |
| if vimfiler#get_file().vimfiler__is_directory | |
| t | |
| else | |
| e | |
| endif | |
| endfunction |
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
| Tags = %w[ruby haskell c++ scala java c# js php agda idris julia ocaml] | |
| module BestMatch | |
| module_function | |
| def distance_tags a, b | |
| sum(a & b) / sum(a) | |
| end | |
| def sum tags |
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 f a={}, **b | |
| [a, b] | |
| end | |
| # huh? | |
| f({:a => 0}) # => [{}, {:a => 0}] | |
| # as expected | |
| f(0) # => [0, {}] |
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 reply to: https://twitter.com/plataformatec/status/525670283899072513 | |
| Hi, | |
| This would probably be a long story, and I am not going to go | |
| through all the details here. You're doing well in what | |
| could be done, but in general, I oppose to build a user system | |
| on top of some generic framework. The reason is that a user | |
| system could be very specific to business logic, and it | |
| could be very hard to customize devise in a way that works |
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
| # slow as hell: | |
| require 'rubygems/gem_runner' | |
| Gem::GemRunner.new.run(['install', gem_path]) | |
| # fast! | |
| require 'rubygems/commands/install_command' | |
| # read ~/.gemrc | |
| Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath]) | |
| Gem::Command.extra_args = Gem.configuration[:gem] |
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
| 00:02 ~/p/g/muack *master> mutant -Ilib -rmuack --use pork Muack | |
| Mutant configuration: | |
| Matcher: #<Mutant::Matcher::Config match_expressions=[<Mutant::Expression: Muack>] subject_ignores=[] subject_selects=[]> | |
| Integration: pork | |
| Expect Coverage: 100.00% | |
| Jobs: 8 | |
| Includes: ["lib"] | |
| Requires: ["muack"] | |
| F.................................................F.......F...................Muack.reset:/Users/godfat/project/godfat/muack/lib/muack.rb:16 | |
| - pork:Muack |
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
| 04:17 ~/p/g/muack adopt-pork-1.0.0> mutant -Ilib -rmuack --use pork Muack | |
| Mutant configuration: | |
| Matcher: #<Mutant::Matcher::Config match_expressions=[<Mutant::Expression: Muack>] subject_ignores=[] subject_selects=[]> | |
| Integration: pork | |
| Expect Coverage: 100.00% | |
| Jobs: 8 | |
| Includes: ["lib"] | |
| Requires: ["muack"] | |
| ..............................................................F.......................FFMuack.reset:/Users/godfat/project/godfat/muack/lib/muack.rb:16 | |
| - pork:Muack::IsAsatisfy |
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
| sudo mv /usr/include/c++ /usr/include/c++.bak # avoid conflicting, might not be needed | |
| brew install --HEAD ruby-install | |
| brew tap homebrew/versions | |
| brew install llvm35 --with-libcxx --with-clang --with-lld --all-targets --rtti | |
| env CC=clang-3.5 CXX=clang++-3.5 CXXFLAGS=-stdlib=libc++ LDFLAGS='-L/usr/local/lib/llvm-3.5/usr/lib -lc++' ruby-install rbx -- --llvm-config llvm-config-3.5 | |
| sudo mv /usr/include/c++.bak /usr/include/c++ # restore g++ headers |
OlderNewer