A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
// source: http://stackoverflow.com/a/9251169/649239 | |
var escape = document.createElement('textarea'); | |
function escapeHTML(html) { | |
escape.innerHTML = html; | |
return escape.innerHTML; | |
} | |
function unescapeHTML(html) { |
var params = {}; | |
var queryString = location.search.substring(1); // For # params use location.hash | |
var regex = /([^&=]+)=([^&]*)/g; | |
var m; | |
while (m = regex.exec(queryString)) { | |
params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | |
} |
<?php | |
// inside included file | |
defined('INCLUDE') or die('No direct access allowed.'); | |
?> | |
<?php | |
// inside includer | |
define('INCLUDE', true); | |
?> |
<?php | |
// db info | |
$db_host = 'localhost'; // local only connection | |
$db_port = 3306; // default mysql port | |
$db_database = 'db_user'; // database username | |
// initiate dns string | |
$dns = "mysql:host=$db_host;port=$db_port;dbname=$db_database"; | |
// create database object or close connection |