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
def recu(x): | |
li = [] | |
lista = [] | |
li.append('numero') | |
while x > 1: | |
if x % 2: | |
x = x * 3 + 1 | |
lista.append(x) | |
else: | |
x = x / 2 |
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 | |
//old way (and with this doesn't work the drag and drop order feature) | |
$my_group = getGroupDuplicates("some_field"); | |
for($i=1;$i <= $my_group;$i++){ | |
echo get('some_Field',$i); | |
} | |
//new way | |
$the_order = getGroupOrder('some_field'); |
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 | |
/** | |
* Magic Fields's debug Class | |
* | |
* @package Magic Fields | |
* @subpackage tools | |
*/ | |
class Debug{ | |
/** |
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
function exclude_writepanels_posts($where){ | |
global $wpdb, $parent_file; | |
if( $parent_file != 'edit.php' ) return $where; | |
if (empty($_GET['filter-posts'])){ | |
$where = $where . " AND 0 = (SELECT count($wpdb->postmeta.meta_value) | |
FROM $wpdb->postmeta WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID and $wpdb->postmeta.meta_key = '_mf_write_panel_id')"; | |
} | |
return $where; |
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 | |
function yourfunction($atts) { | |
//get the value of the custom field. | |
$value = get("yourfieldname"); | |
return $value; | |
} | |
add_shortcode('your_shortcode', 'yourfunction'); | |
?> |
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 python | |
# -*- coding: utf-8 -*- | |
version = "1.0" | |
__module_name__ = "forceutf-8.py" | |
__module_version__ = version | |
import xchat | |
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 python | |
#http://fitorec.wordpress.com/2009/12/18/deteccion-de-intrusos-en-nuestra-wi-fi/ | |
import urllib2 | |
import re | |
opener = urllib2.Request('http://home/',None,{}) | |
response = urllib2.urlopen(opener) | |
response = response.read() | |
#obteniendo el nombre de las maquinas |
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 | |
function multiline_with_more($multiline_name){ | |
global $post; | |
///Get the content of the multiline custom field | |
$multiline = get('multiline'); | |
//if the page is_Single we replace the <!--more--> tag for: | |
//<span id="more-9-{$custom_Field_name"></span> | |
if(is_single($post->ID)){ | |
preg_match('/(.*)(\<\!\-\-more\-\-\>)(.*)/is',$multiline,$matches); | |
return $matches[1]."<span id='more-{$post->ID}-{$multiline_name}'></span>".$matches[3]; |
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
brew install bash-completion |
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
#bash completion | |
if [ -f /usr/local/Cellar/bash-completion/1.2/etc/bash_completion ]; then | |
. /usr/local/Cellar/bash-completion/1.2/etc/bash_completion | |
fi | |