This file contains 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 | |
# | |
# This script filters rustfmt output for format-on-save workflows in text | |
# editors. | |
# | |
# Usage: | |
# | |
# rustfmt-skip-children /path/to/source | |
# | |
# In particular, it: |
This file contains 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
# base.rb | |
class Base | |
def foo | |
puts "BASE" | |
end | |
end | |
# derived.rb |
This file contains 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 $HOME/.rvm/scripts/rvm | |
rvm use ruby-1.9.3-p374 | |
rvm rubygems 1.8.24 |
This file contains 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
# Put this into extra/my_proj/helpers.rb | |
module MyProj | |
module Helpers | |
extend ActionView::Helpers | |
end | |
end |
This file contains 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
MyProj::Helpers.pluralize(1, 'person') | |
MyProj::Helpers.simple_format(string) |
This file contains 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
values: [3, 0, 2, 3, 0, 5, 7, 9, 7, 4, 4, 4, 4, 6, 8, 3, 6, 6, 3, | |
9, 3, 9, 1, 6, 7, 7, 3, 1, 7, 4, 7, 9, 8, 8, 6, 6, 0, 0, 3, 6, 1, | |
1, 0, 5, 3, 9, 5, 8, 4, 1, 0, 7, 9, 1, 6, 4, 0, 8, 8, 9, 7, 2, 9, | |
5, 8] | |
⌜·············3·⌝ | |
⌜0···········⌝ ⌜3············⌝ | |
0 ⌜·····2⌝ 3 ⌜·····5············⌝ | |
⌜···1·⌝ 2 ⌜4·⌝ ⌜7·············⌝ | |
⌜0·⌝ ⌜1·⌝ ⌜···4 ⌜4·⌝ ⌜······7 ⌜······9·⌝ | |
0 ⌜0⌝ 1 ⌜1⌝ ⌜3·⌝ 4 ⌜4⌝ ⌜6·⌝ ⌜····8·⌝ ⌜9·⌝ |
This file contains 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
values: [4, 5, 0, 6, 2, 9, 7, 4, 1, 3, 8, 8, 2, 2, 7, 6, 8, 0, 0, | |
6, 9, 9, 0, 9, 3, 5, 6, 6, 2, 4, 0, 0, 0, 8, 7, 7, 0, 8, 6, 7, 7, | |
1, 7, 4, 1, 5, 6, 0, 9, 4, 0, 8, 0, 1, 0, 2, 9, 1, 4, 3, 5, 3, 4, | |
0, 1] | |
⌜··························4······⌝ | |
⌜0·················⌝ ⌜····5····⌝ | |
0 ⌜·····2····⌝ ⌜4·⌝ ⌜6··················⌝ | |
⌜·········1·⌝ ⌜··3·⌝ 4 ⌜4⌝ ⌜·6 ⌜···········9·⌝ | |
⌜0·⌝ ⌜1·⌝ ⌜2⌝ ⌜3⌝ 4 4⌝ ⌜5⌝ ⌜7······⌝ ⌜9·⌝ | |
0 ⌜0·⌝ 1 ⌜1⌝ 2 2⌝ 3 3 4 5 5 ⌜···7 ⌜8·⌝ 9 ⌜9⌝ |
This file contains 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
values: [3, 9, 8, 5, 5, 0, 6, 3, 4, 4, 5, 0, 8, 3, 2, 7, 8, 3, 6, | |
4, 3, 7, 8, 4, 1, 5, 1, 5, 5, 0, 3, 5, 8, 8, 7, 0, 4, 5, 1, 0, 2, | |
7, 7, 2, 2, 9, 6, 2, 2, 0, 9, 9, 0, 2, 7, 8, 5, 2, 4, 1, 6, 1, 3, | |
9, 7] | |
⌜··················3·······································⌝ | |
⌜0·⌝ ⌜······9·⌝ | |
0 ⌜0········⌝ ⌜···················8·⌝ ⌜9⌝ | |
0 ⌜···2·⌝ ⌜··········5·⌝ ⌜8·⌝ 9 9⌝ | |
⌜1·⌝ ⌜2·⌝ ⌜3····⌝ ⌜5·······⌝ 8 ⌜8⌝ 9 | |
⌜·1 ⌜1⌝ 2 ⌜2·⌝ 3 ⌜··4·⌝ 5 ⌜6···⌝ 8 8⌝ |
This file contains 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
# encoding: UTF-8 | |
def tree_insert(root, v) | |
if !root[:v] | |
root.clear | |
root.merge!( | |
:v => v, | |
:p => nil, | |
:n => nil | |
) | |
elsif root[:v] > v |
This file contains 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
// A sample Emit() method on a signal object for slots that take | |
// two arguments. | |
void Emit( TArg1 a1, TArg2 a2 ) const | |
{ | |
// Here, the iterator is just a pointer to a list node. | |
// Incrementing the iterator means that we just follow the node's | |
// "next" pointer. But what happens if the current node is freed | |
// before the iterator can be incremented? | |
for ( ConnectionListIter i = m_oConnections.begin(); | |
i.isValid(); |
NewerOlder