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 Routing::Router | |
| def initialize(recipient, options = {}) | |
| options.assert_valid_keys(:customer) | |
| @customer = options[:customer] | |
| @recipient = PhoneNumber.new(recipient).internationalise(:local_country => @customer.site_country) | |
| end | |
| def destination | |
| destination = ( |
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
| html, body, div, span, applet, object, iframe, | |
| h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
| a, abbr, acronym, address, big, cite, code, | |
| del, dfn, em, font, img, ins, kbd, q, s, samp, | |
| small, strike, strong, sub, sup, tt, var, | |
| dl, dt, dd, ol, ul, li, | |
| fieldset, form, label, legend, | |
| table, caption, tbody, tfoot, thead, tr, th, td { | |
| margin: 0; | |
| padding: 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
| var lastKnownOrientation = null; | |
| function rotate() { | |
| if(window.orientation != lastKnownOrientation) { | |
| lastKnownOrientation = window.orientation; | |
| updateRotation(); | |
| } | |
| } | |
| function updateRotation() { |
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
| FinancialTransaction::ErsteBankImporter.any_instance.expects(:initialize).once.with(anything, {:foo => 42}) | |
| FinancialTransaction.detect_importer( | |
| StringIO.new("Bezeichnung;Valutadatum;Betrag;Währung\n"), | |
| :foo => 42 | |
| ) |
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
| module DeepFreezing | |
| # „Deep freezes“ the array, that is: | |
| # - if the element responds to deep_freeze itself, | |
| # like Array and Hash should, call it. | |
| # - if the element responds to freeze, call it | |
| # - freeze self | |
| # | |
| # ==== Returns | |
| # self | |
| # |
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
| zfs recv -d ~/bc.zone.zfs rpool | |
| # That included /zones/bc, /zones/bc/ROOT and /zones/bc/ROOT/zbe | |
| zonecfg -z bc create -a /zones/bc | |
| zoneadm -z bc attach | |
| The -a or -r option is required when there is no active root dataset. | |
| pfexec zoneadm -z bc attach -r /zones/bc | |
| cannot create 'rpool/zones/bc/ROOT': dataset already exists |
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
| while out_open || err_open | |
| next unless ready = IO.select([out_pipe], [err_pipe], nil, Ticks) | |
| if ready.flatten.include?(out_pipe) | |
| out_open = (output.write(out_pipe.readpartial(BlockSize - 2)) rescue false) | |
| end | |
| if ready.flatten.include?(err_pipe) | |
| err_open = (errors.write(err_pipe.readpartial(BlockSize - 2)) rescue false) | |
| 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
| start_time = timestamp | |
| open = true | |
| status = Open4.popen4(command) do |pid, _, out, err| | |
| while(open) | |
| elapsed = (timestamp - start_time) | |
| if elapsed > CommandTimeout | |
| out.close rescue puts "out close err" |
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
| source .paths # Sets up $PATH | |
| export EDITOR="vim" | |
| export GIT_EDITOR=${EDITOR} | |
| export MANPATH="$PATH:/usr/share/man:/opt/local/share/man" | |
| # No reason to export shell variables to each application. | |
| PS1="[\u@\h \w \$] " | |