
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
from munch import munchify | |
class Locator: | |
locator_kinds = {"id", "xpath"} | |
_context = None | |
def __init__(self, *args, **kwargs): | |
self.valid_parameters = [f"find_by__{kind}" for kind in self.locator_kinds] | |
self._locators = {} |
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
from munch import munchify | |
class Locator: | |
locator_kinds = {"id", "xpath"} | |
_context = None | |
def __init__(self, *args, **kwargs): | |
self.valid_parameters = [f"find_by__{kind}" for kind in self.locator_kinds] | |
self._locators = {} |
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/python2.7 | |
# -*- coding: utf-8 -*- | |
import subprocess | |
from os import putenv | |
PHP_ABS_PATH = '/home/danielm/bin/php' | |
SATIS_ABS_PATH = '/home/danielm/satis/bin/satis' | |
PACKAGIST_BUILD_CONF_PATH = '/home/danielm/packagist/config.json' | |
PACKAGIST_OUTPUT_PATH = '/home/danielm/webapps/lumecomposerpackages/' |
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
<div class="wpsweeps {% if participating %} giveup {% endif %}"> | |
<img src="{{ icon_url }}"> | |
{% if participating %} | |
<a href="{{ giveup_url }}"> | |
{{ wanna_giveup_msg }} | |
</a> | |
{% else %} | |
<a href="{{ url }}"> | |
{{ link_name }} | |
</a> |
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
// Create post object | |
$newpost = array( | |
'post_title' => 'My post', | |
'post_content' => 'This is my post.', | |
'post_status' => 'publish', | |
'post_author' => 1, // admin | |
); | |
// Insert the post into the database |
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 | |
/** | |
* This functions runs like array_unique but is based on similarity | |
* and the math is based on similar_text to know better, see: php.net/similar_text | |
* | |
* @param [type] $array [description] | |
* @param integer $howMuch [description] | |
* @param [type] $callback [description] | |
* @return [type] [description] |
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 | |
/** | |
* Get posts in range date by a specific custom field(post meta) | |
* But, the date needs to be in the format YYYYMMDD | |
* | |
* @param string $start start date | |
* @param string $end end date | |
* @param string $field specific custom field | |
* @param string $ctype |