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
<?php | |
function escape_database_for_grant( $d ) | |
{ | |
$search = array( '_', '%' ); | |
$replace = array ( '\_', '\%' ); | |
return str_replace( $search, $replace, $d ); | |
} | |
?> |
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
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use Data::Dumper; | |
sub f { while ( <> ) {} } | |
my $a = 1; |
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 | |
false; echo "false alone: $?" | |
false | head; echo "false piped to head: $?" | |
set -o pipefail | |
false | head; echo "false 'pipefailed' to head: $?" |
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
sub Pa # Partially Apply | |
{ | |
my ( $f, @a ) = @_; | |
sub { $f->( @a, @_ ) } | |
} |
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
<?php | |
function Pa() // Partially Apply | |
{ | |
$origArgs = func_get_args(); | |
return function() use ( $origArgs ) | |
{ | |
$allArgs = array_merge( $origArgs, func_get_args() ); | |
return call_user_func_array( 'call_user_func', $allArgs ); | |
}; | |
} |
NewerOlder