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
#!/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 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 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 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
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 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
#!/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 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
// 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 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
/** | |
* 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 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
/** | |
* 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); |
NewerOlder