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_installed=`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` | |
| echo $php_installed | |
| sudo apt-get purge $php_installed |
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
| $bloque = (object) module_invoke('debate','block','view',6); | |
| print theme('block',$bloque); |
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
| var url = 'http://drupalcon.tut2tech.com/services/json'; | |
| var datos = {method: 'user.get',uid:1}; | |
| var data = {}; | |
| var xhr = Titanium.Network.createHTTPClient(); | |
| xhr.onload = function(){ |
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 inseguridad_form_user_register_alter(&$form, &$form_state) { | |
| if(preg_match("/register|user\/create/",$_SERVER['REQUEST_URI']) ){ | |
| $form['#validate'][] = 'inseguridad_user_register_validate'; | |
| } | |
| } | |
| function inseguridad_user_register_validate($form, &$form_state){ | |
| $pass1 = $form['#parameters'][1]['post']['pass']['pass1']; | |
| if( preg_match("/[^a-zA-Z0-9]/",$pass1)) | |
| form_set_error('inseguridad', t("La contraseña solo admite números y letras mayúsculas y minúsculas.")); |
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
| $minuit = strtotime("00:00:00.00"); | |
| $hora1='00:00:20.00'; | |
| $timestamp1 = strtotime($hora1)-$minuit; | |
| $hora2='00:00:40.00'; | |
| $timestamp2 = strtotime($hora2)-$minuit; | |
| $SUMA=$timestamp1+$timestamp2+$minuit; | |
| echo date("H:i:s",$SUMA); |
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
| var hoy = new Date(); | |
| var futuro = new Date(2011,02,30); | |
| var diff = futuro-hoy; | |
| diff /= 1000; | |
| var days = Math.floor(diff / (60*60*24) - 27); | |
| diff = diff - (days+27) *(60*60*24); | |
| var hours = Math.floor(diff/(60*60)); | |
| diff = diff - hours * (60*60); |
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 PIL import Image | |
| path = '/Users/gimenete/Desktop/famfamfam_silk_icons_v013/icons/' | |
| names = ['add.png', 'accept.png', 'anchor.png', 'bomb.png', 'cd_add.png', 'clock.png'] | |
| output = 'sprites.png' | |
| vpadding = 16 | |
| padding = 2 | |
| w = 0 | |
| h = 0 |
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
| """ | |
| Takes a list of filenames via standard input and uploads them to Amazon S3. | |
| Requires S3.py: | |
| http://developer.amazonwebservices.com/connect/entry.jspa?externalID=134&categoryID=47 | |
| Usage: | |
| cd /directory/with/media/files/ | |
| find | grep -v ".svn" | python /path/to/update_s3.py |
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 -*- | |
| # | |
| # Copyright 2011 mishudark <moonsadly@gmail.com><mishudark@astrata.com.mx> | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2 of the License, or | |
| # (at your option) any later version. | |
| # |
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 whoami(self): | |
| return type(self).__name__ |