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/sh | |
if test -f .merlin; then | |
echo ".merlin already exists, bailing out ..." >&2 | |
exit 1 | |
else | |
# You could add your default EXT's and such to this list: |
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
# Capistrano 2 | |
before "deploy", "friday:good_luck" | |
namespace :friday do | |
friday_jumper = %{ | |
┓┏┓┏┓┃ | |
┛┗┛┗┛┃⟍ ○⟋ | |
┓┏┓┏┓┃ ∕ Friday | |
┛┗┛┗┛┃ノ) |
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
fn utf8_truncate(input : &mut String, maxsize: usize) { | |
let mut utf8_maxsize = input.len(); | |
if utf8_maxsize >= maxsize { | |
{ let mut char_iter = input.char_indices(); | |
while utf8_maxsize >= maxsize { | |
utf8_maxsize = match char_iter.next_back() { | |
Some((index, _)) => index, | |
_ => 0 | |
}; | |
} } // Extra {} wrap to limit the immutable borrow of char_indices() |