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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>MySQL Connection Test</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<style type="text/css"> | |
#wrapper { | |
width: 600px; | |
margin: 20px auto 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
<?php | |
/* | |
Levi Thornton from boogybonbon and wordze generously posted his php Markov | |
Chain class.. unfortunately there is a missing $nn++ thus the class can hang, | |
the working version is below all credit to Levi for the code, i just fixed a | |
bug. | |
Example Usage: | |
------------------ |
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 | |
/* | |
* Random pronounceable password generator | |
* | |
* Found the orignal function here http://bit.ly/1iKeLBO | |
* Added in a capital letter. | |
*/ | |
function rppg(){ | |
$pw = ''; |
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
plugins=("http://downloads.wordpress.org/plugin/theme-check.20131213.1.zip" | |
"http://downloads.wordpress.org/plugin/debug-bar.0.8.1.zip" | |
"http://downloads.wordpress.org/plugin/log-deprecated-notices.0.2.zip" | |
"downloads.wordpress.org/plugin/debogger.0.71.zip" | |
"http://downloads.wordpress.org/plugin/monster-widget.zip" | |
"http://downloads.wordpress.org/plugin/wordpress-beta-tester.0.99.zip" | |
"http://downloads.wordpress.org/plugin/regenerate-thumbnails.zip") | |
for plugin in "${plugins[@]}" | |
do | |
sudo wget $plugin |
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 __future__ import division | |
# example points from http://www.coolmath.com/algebra/08-lines/06-finding-slope-line-given-two-points-01.htm | |
(x1, y1) = (-2,-1) | |
(x2, y2) = (4,3) | |
slope = ((y2-y1)/(x2-x1)) | |
print slope |
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 | |
/* | |
* The heat index formula in PHP | |
* https://en.wikipedia.org/wiki/Heat_index#Formula | |
*/ | |
function hi($T,$rh) { | |
$c1 = -42.379; | |
$c2 = 2.04901523; | |
$c3 = 10.14333127; |
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 | |
/* | |
* Wind Chill formula in PHP | |
* https://en.wikipedia.org/wiki/Wind_chill | |
*/ | |
function windChillTemp($V,$Ta) | |
{ | |
$Vpower = pow($V, 0.16); | |
$TaV = $Ta * $Vpower; |
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
# enable the site | |
a2ensite example.com | |
# restart apache2 | |
service apache2 reload |
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 | |
if (version_compare(phpversion(), '5.3.10', '<')) { | |
// php version isn't high enough | |
echo 'version too low.'; | |
} | |
else { | |
echo 'good to go.'; | |
} |
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 | |
$password_length = 8; | |
function password_strength($password) { | |
$returnVal = True; | |
if ( strlen($password) < $password_length ) { | |
$returnVal = False; | |
} |
OlderNewer