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
| Bundler.require | |
| book = Gutenberg::Book.new_from_txt 'data/pg11.txt' | |
| db = Sequel.sqlite | |
| db.run "CREATE VIRTUAL TABLE units USING fts5(content);" | |
| units = db[:units] | |
| db.transaction do | |
| book.each_with_index do |unit, index| |
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
| CSV.read file, col_sep: "\t", quote_char: "\x00" |
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 'pty' | |
| require 'expect' | |
| qemu_command = "qemu-system-x86_64 -enable-kvm -cdrom ~/alpines/alpine-virt-3.6.2-x86_64.iso -nographic" | |
| PTY.spawn qemu_command do |r, w, pid| | |
| p pid | |
| r.expect /localhost login: / do |message| | |
| puts "The message is #{message}." |
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
| [user] | |
| email = [email protected] | |
| name = Anatoly Chernow | |
| [credential] | |
| helper = cache --timeout=3600 | |
| [core] | |
| excludesfile = ~/.gitignore_global | |
| [alias] | |
| co = checkout | |
| br = branch |
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
| # Numerous always-ignore extensions | |
| *.diff | |
| *.err | |
| *.orig | |
| *.rej | |
| *.swo | |
| *.swp | |
| *.vi | |
| *~ | |
| *.sass-cache |
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/ips' | |
| class Array | |
| def to_proc | |
| if self[0].is_a? Symbol | |
| method, *arguments = self | |
| -> receiver { receiver.send method, *arguments } | |
| elsif self[1].is_a? Symbol | |
| receiver, method, *arguments = self | |
| -> argument { receiver.send method, argument } |
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
| unbind C-b | |
| set -g prefix ` | |
| bind-key r source-file ~/.tmux.conf |
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
| # https://www.linux.org.ru/forum/development/13492726 | |
| class Glob | |
| def self.=== string | |
| string.include? ?* | |
| end | |
| end | |
| class MyHash < Hash | |
| def 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
| diff --git a/lib/mutant/isolation/fork.rb b/lib/mutant/isolation/fork.rb | |
| index e2476478..36130b62 100644 | |
| --- a/lib/mutant/isolation/fork.rb | |
| +++ b/lib/mutant/isolation/fork.rb | |
| @@ -61,8 +61,8 @@ module Mutant | |
| # @return [Object] | |
| def result | |
| devnull.call do |null| | |
| - stderr.reopen(null) | |
| - stdout.reopen(null) |
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
| pug = require 'pug' | |
| file = process.argv[2] | |
| template = pug.compileFile file | |
| console.log template name: 'Timothy' |