This is a presentation designed for the August 16, 2012 meeting of the Baltimore Perl Mongers. It is not quite an introduction to the idea of git (as many of the members are already aquainted with it to some degree), but a discussion of some of the more interesting features that can be folded into a workflow quickly and
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# etc. etc. etc......... | |
unless request.user_agent =~ /AppleWebKit/ | |
# sub out all diagram corners with ascii + | |
%w(┌ ┐ └ ┘).each do |corner| | |
data.gsub!(corner, '+') | |
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
#!/usr/bin/env perl | |
use v5.14; | |
use warnings; | |
use perl5i::2; | |
[0 .. 5]->foreach(func($i) { | |
say "current value of i is $i" | |
}); |
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
package POE::Component::dns::monitor::sniffer; | |
use POE; | |
use warnings; | |
use strict; | |
sub spawn { | |
my ($session) = POE::Session->create( | |
inline_states => { | |
_start => sub { |
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
# do regular system bashrc stuff, if there's one set up | |
if [ -f /etc/bashrc ] ; then | |
. /etc/bashrc | |
fi | |
# use 256 colors if available, otherwise default to | |
if [ -f /usr/share/terminfo/x/xterm-256color ] ; then | |
export TERM=xterm-256color | |
else | |
export TERM=xterm |
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
# commands that are too long to reasonably be represented | |
$_gwt = "git tag | grep -e '^release-[0-9]\\{1,\\}\$'" | |
$_gwl = "${_gwt} | cut -d\\- -f2 | sort -rn | head -n1" | |
# figure out how to deploy this project | |
case "$mode" { | |
# ... | |
# prod box, make sure the latest code is loaded | |
'production': { |
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
node testnode { | |
git::repository { "repo": | |
# default values | |
server_user => "root", | |
owner_user => "root", | |
owner_group => "root", | |
target_dir => "repo", | |
githost => "githost", | |
gituser => $server_user, | |
target_dir => $name, |
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
#!/usr/bin/env ruby | |
class SomeClass | |
def self.add_two_numbers(one, two) | |
one + two | |
end | |
def add_two_numbers(one, two) | |
self.class.add_two_numbers(one, two) | |
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
#!/usr/bin/env ruby | |
# discover OS information to see if we should use pygments to colorize code | |
if RUBY_PLATFORM =~ /cygwin|mswin|mingw|bccwin|wince|emx/ | |
# no clue if this will work at all on windows, so whatever | |
USE_PYGMENTS = true | |
PYGMENTS_BLACKLIST = [] | |
elsif RUBY_PLATFORM =~ /darwin/ | |
version = `sw_vers -productVersion` | |
if version =~ /^10\.7/ |
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
<?php | |
$__TEST__COUNT__ = 0; | |
$__TEST__SUCCESS__ = 0; | |
$__TEST__FAILURE__ = 0; | |
$__EXPECTED__TESTS__ = null; | |
function no_plan() { | |
global $__EXPECTED__TESTS__; | |
$__EXPECTED__TESTS__ = 'none'; |