This file contains 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
/** | |
* Parse URL and retrieve a GET parameter | |
* | |
* @param variable Name of variable to retrieve from URL | |
* @returns Value of the variable or null if not present | |
* | |
* from: http://stackoverflow.com/questions/827368/use-the-get-paramater-of-the-url-in-javascript | |
*/ | |
function getQueryVariable(variable) { | |
var query = window.location.search.substring(1); |
This file contains 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
/** | |
* Returns the value of the selected radio button in the radio group, null if | |
* none are selected, and false if the button group doesn't exist | |
* | |
* @param {radio Object} or {radio id} el | |
* OR | |
* @param {form Object} or {form id} el | |
* @param {radio group name} radioGroup | |
* | |
* From: http://xavisys.com/using-prototype-javascript-to-get-the-value-of-a-radio-group/ |
This file contains 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
// helpers to manipulate cookies. see: http://www.quirksmode.org/js/cookies.html | |
/** | |
* Create a cookie for site | |
* | |
* @param name Name for cookie | |
* @param value Value for cookie | |
* @param minutes Number of minutes this cookie will be valid for. | |
*/ | |
function createCookie(name, value, minutes) { |
This file contains 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 | |
# --------------------------------------------------------------------------------------- | |
# Configuration options | |
# --------------------------------------------------------------------------------------- | |
DEFAULT_ADMIN_THEME='rubik' # Other common options: seven - adaptivetheme_admin | |
DEFAULT_THEME='adaptivetheme' # Other common options: omega - zen - bartik | |
ADMIN_PASSWORD='<strong-password>' |
This file contains 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
import feedparser | |
def color(this_color, string): | |
return "\033[" + this_color + "m" + string + "\033[0m" | |
print color('34', '-' * 70) | |
print color('1;34', ' ' * 10 + 'D R U P A L / P L A N E T') | |
print color('34', '-' * 70) |
This file contains 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 color(this_color, string): | |
return "\033[" + this_color + "m" + string + "\033[0m" | |
for i in range(30, 38): | |
c = str(i) | |
print('This is %s' % color(c, 'color ' + c)) | |
c = '1;' + str(i) | |
print('This is %s' % color(c, 'color ' + c)) |
This file contains 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 | |
# Execute a command and display command with colors in console | |
exec() { | |
CMD=$* | |
S="\033[37mExecuting [\033[32m$CMD\033[37m]" | |
echo -e $S | |
eval $CMD | |
} |
This file contains 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
<html> | |
<head> | |
<title>Titulo</title> | |
</head> | |
<body><p>Titulo</p> | |
<h1>This is an h1 header</h1> | |
<h2>This is an h2 header</h2> | |
<h3>This is an h3 header</h3> | |
<h4>This is an h4 header</h4> | |
<h5>This is an h5 header</h5> |
This file contains 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 -x | |
# | |
# Script que actualiza el codigo en el ambiente a donde se hace push | |
# | |
# | |
# The "post-receive" script is run after receive-pack has accepted a pack | |
# and the repository has been updated. It is passed arguments in through | |
# stdin in the form | |
# <oldrev> <newrev> <refname> | |
# For example: |
This file contains 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 | |
/** | |
* Implements hook_menu(). | |
*/ | |
function xxxxx_menu() { | |
$items['path'] = array( | |
'title' => '[Title]', | |
'access callback' => TRUE, | |
'page callback' => 'xxxxx_render_page', |
OlderNewer