This text is italic
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 | |
/* | |
* PDO DATABASE CLASS | |
* Connects Database Using PDO | |
* Creates Prepeared Statements | |
* Binds params to values | |
* Returns rows and results | |
*/ | |
class Database { | |
private $host = DB_HOST; |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/////////////////////////////// | |
// HOW TO SANITIZE RADIO BOX // | |
/////////////////////////////// | |
function theme_slug_customizer($wp_customize) { | |
//your section | |
$wp_customize->add_section( | |
'theme_slug_customizer_your_section', | |
array( | |
'title' => esc_html__('Your Section', 'theme_slug'), |
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 | |
$host = 'localhost'; | |
$user = 'root'; | |
$password = '123456'; | |
$dbname = 'pdoposts'; | |
// Set DSN | |
$dsn = 'mysql:host='. $host .';dbname='. $dbname; | |
// Create a PDO instance |
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
# Login via SSH with password (LOCAL SERVER) | |
> ssh brad@192.168.1.29 | |
# Create folder, file, install Apache (Just messing around) | |
mkdir test | |
cd test | |
touch hello.txt | |
sudo apt-get install apache2 | |
# Generate Keys |
- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
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
function ImportCSV2Array($filename) { | |
$row = 0; | |
$col = 0; | |
$handle = @fopen($filename, "r"); | |
if ($handle) { | |
while (($row = fgetcsv($handle, 4096)) !== false) { | |
if (empty($fields)) { | |
$fields = $row; | |
continue; | |
} |
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
const http = new easyHTTP(); | |
// Get Posts | |
http.get("https://jsonplaceholder.typicode.com/posts", function(err, posts) { | |
if (err) { | |
console.log(err); | |
} else { | |
console.log(posts); | |
} | |
}); |
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 | |
$host = ''; | |
$dbname = ''; | |
$user = ''; | |
$password = ''; | |
try { | |
$pdo = new PDO("mysql:host=" . $host . ";dbname=" . $dbname, $user, $password); | |
} catch (PDOException $e) { | |
die("ERROR: Could not connect. " . $e->getMessage()); |
OlderNewer