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
#!/usr/bin/env bash | |
##### | |
# Script to install postfix | |
##### | |
DOMAIN="example.com" | |
EMAIL="haisum@example.com" | |
PASSWORD="example.com1*" |
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 | |
if (!isset($_GET['user'])) { | |
exit('Not a valid RSS feed. You didn\'nt provide an Instagram user. Send one via a GET variable. Example .../instarss.php?user=snoopdogg'); | |
} | |
header('Content-Type: text/xml; charset=utf-8'); | |
$html = file_get_contents('http://instagram.com/'.$_GET['user'].'/'); | |
$html = strstr($html, '{"static_root'); |
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
// Ajax File upload with jQuery and XHR2 | |
// Sean Clark http://square-bracket.com | |
// xhr2 file upload | |
// data is optional | |
$.fn.upload = function(remote,data,successFn,progressFn) { | |
// if we dont have post data, move it along | |
if(typeof data != "object") { | |
progressFn = successFn; | |
successFn = data; | |
} |
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 | |
class Config { | |
//$path is the value that going to be pass thought for exmaple "Config::get('mysql/host')" the part 'mysql/host' will be the path. | |
public static function get($path = null){ | |
if($path) { | |
//$config make it easier to write $GLOBALS['config']; | |
$config = $GLOBALS['config']; | |
// Explode will read each value in parts using the forward slash for example mysql/host mysql is first part and host is the seconned part. | |
$path = explode('/', $path); | |
// For every value in $path will be store in a variable called $bit |
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 | |
class Config { | |
//$path is the value that going to be pass thought for exmaple Config::get('mysql/host') the part 'mysql/host' will be the path. | |
public static function get($path = null){ | |
if($path) { | |
//$config make it easier to write $GLOBALS['config']; | |
$config = $GLOBALS['config']; | |
// Explode will read value my parts and the / for example mysql/host mysql is first part and mysql is the seconned part. | |
$path = explode('/', $path); | |
} |
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 | |
//start the session | |
session_start(); | |
//$GLOBALS['config'] will read the config.php class | |
$GLOBALS['config'] = array( | |
'mysql' => array( | |
'host' => '127.0.0.1', | |
'username' => 'root', |
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
'password' => 'Founder2013', |
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 | |
function escape($string) { | |
return htmlentities($string, ENT_QUOTES, 'UTF-8'); | |
//ENT_QUOTES find any double or sigle qoutes and remove them. | |
// UFT-8 text format type | |
} |