The Gearman job server supports a text-based protocol to pull information and run some administrative tasks. The following commands are supported:
workers
status
maxqueue
shutdown
version
<?php | |
/** | |
* PHP Regex to validate a Twitter hashtag | |
* | |
* Useful for validating a text input (an HTML form in your CMS or custom application) that must be a valid Twitter hashtag. | |
* Valid examples: #a, #_, #_1, #_a, #1a, #áéìôü, #123hàsh_täg446 | |
* Invalid examples: #1, ##hashtag, #hash-tag, #hash.tag, #hash tag, #hashtag!, (any hashtag that is more than 140 characters long, hash symbol included) | |
* | |
* Regex explanation: | |
* First, the lookahead assertion (?=.{2,140}$) checks the minimum and max length, as explained here http://stackoverflow.com/a/4223213/1441613 |
The Profile > Payment form doesn't involve any transaction, it is just to "save" their credit card data (on Paymill servers, not ours) for later use, on future purchases on our webapp.
That way the user doesn't need to re-enter over and over his credit card deatils each time he wants to make a purchase, smoothing as much as possible the checkout process.
TL;DR PayPal fatal. Paymill molamil.
PayPal no ofrece en España un método de pago que se integre por completo con tu webapp. La integración más básica Pago estándar consiste básicamente en redirigirte a PayPal e introducir ahí los datos de tu tarjeta. Es decir, la clásica página estándar de checkout de PayPal, con su típico look & feel.
La alternativa algo más avanzada, Pasarela integral, permite que en esa página externa de PayPal se pueda personalizar el logo... y algún que otro detalle (según PayPal "hasta 21 elementos gráficos").
<?php | |
// PHP Logical operators: The difference between OR vs ||, AND vs && | |
// Key concept #1: "||" and "&&" have greater precedence than "=", "OR", "AND" | |
// http://php.net/manual/en/language.operators.precedence.php | |
// Key concept #2: PHP logical operators are short-circuit | |
// http://en.wikipedia.org/wiki/Short-circuit_evaluation | |
// http://php.net/manual/en/language.operators.logical.php |
<?php | |
class MY_Model extends CI_Model { | |
// Form validation rules | |
protected $rules = array(); | |
// Sets form validation rules | |
protected function set_rules($field_names) | |
{ |
<?php | |
// Possible PHP Bug: | |
// An object is automatically created if an unset object with a property is passed by reference | |
// Inconsistent Warnings depending on the variable type | |
// Live test http://codepad.viper-7.com/ueZkz4 | |
// Possibly related PHP bug https://bugs.php.net/bug.php?id=52237 | |
<?php | |
/** | |
* Takes an associative array in the layout of parse_url, and constructs a URL from it | |
* | |
* see http://www.php.net/manual/en/function.http-build-url.php#96335 | |
* | |
* @param mixed (Part(s) of) an URL in form of a string or associative array like parse_url() returns | |
* @param mixed Same as the first argument | |
* @param int A bitmask of binary or'ed HTTP_URL constants (Optional)HTTP_URL_REPLACE is the default |
<?php | |
// Answer for https://twitter.com/david_bonilla/status/480982446641778688 | |
// Tested: using in_the_loop() conditional | |
add_filter('the_title', 'my_the_title'); | |
function my_the_title($title) { | |
if (in_the_loop()) |
Python Cheatsheets
http://refcardz.dzone.com/refcardz/core-python
http://rgruet.free.fr/
Learn Python in 10 minutes
http://www.stavros.io/tutorials/python/
https://leanpub.com/learn-python