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
#!/bin/bash | |
set -e | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE] | |
${0##*/} -h | |
Open a standard connection in Sequel PRO. |
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 | |
public function payment_update( $postId, $eventId, $raw_post ) { | |
$paymentTypes = array('check' => '', 'cash' => '', 'invoice' => ''); | |
$requestParams = 'event_id=' . $eventId; | |
// make it accept cash if free & assign a message | |
if ( 2 == $raw_post['EventBriteIsDonation'] ) { | |
$requestParams .= '&accept_cash=1'; | |
$requestParams .= '&instructions_cash=' . urlencode( __( 'This event is free to attend', 'tribe-eventbrite' ) ); | |
} else { |
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 Monad | |
attr_reader :value | |
def bind(f) | |
raise "not implemented" | |
end | |
def self.return(v) | |
self.new v | |
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
<?php | |
//pega tudo que tem oi ou ola = (oi|ola) | |
$pattern = "/(oi|ola)/"; | |
//para evitar que palavras derivadas de oi ou ola (ex: foi, escola) sejam capturadas, colocamos \b antes e depois um \W, um "no word" (caractere que não seja uma letra, ex: espaço, vírgula). | |
$pattern = "/\b(oi|ola)\W/"; | |
?> |
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 | |
/* | |
Plugin Name: Edit Title | |
Plugin URI: http://romulodl.com/ | |
Description: Example of OO Wordpress plugin (comments in portuguese) | |
Author: Romulo De Lazzari | |
Version: 0.1 | |
Author URI: http://romulodl.com/ | |
*/ |
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 | |
/** | |
* Example using Word Boundaries (\b) | |
*/ | |
$regex = "/\b4\b/"; | |
$string = "4, 44, 41, 99, 404, 433, 004, 4"; | |
preg_match_all($regex, $string, $matches); | |
print_r($matches); | |
/** |
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 | |
/** | |
* @package Caralho! | |
* @version 1.6 | |
*/ | |
/* | |
Plugin Name: CARALHO | |
Plugin URI: http://pudim.com.br | |
Description: (CARALHO == portuguese of FUCK). If you are getting a blank page because of the "?fb_xd_fragment=$" in your URI, this plugin could be your solution! | |
Author: CARALHO! |