I hereby claim:
- I am randomecho on github.
- I am randomecho (https://keybase.io/randomecho) on keybase.
- I have a public key whose fingerprint is 119D F84C 21E4 E785 9C66 6D17 F21A BCE5 326C 3BC0
To claim this, I am signing this object:
ob_start(); | |
phpinfo(); | |
$phpInfo = ob_get_clean(); | |
$phpInfo = preg_replace('/600(px)?/', '100%', $phpInfo); // table and hr width | |
$phpInfo = str_replace('75%', '95%', $phpInfo); // font-size | |
$phpInfo = preg_replace('/<?([\w]|<|\/|>)*(a:|!DOCTYPE|<html|title|body)(.+)?\\n?/', '', $phpInfo); // main html doc tags |
I hereby claim:
To claim this, I am signing this object:
# ~/.bash_profile | |
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" | |
# Auto-completion helper when you hit tab | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi |
function dump($thevar, $killme = false) | |
{ | |
echo "\n\n".'<pre style="text-align:left;color:#000;background:#fff;padding:1em;border:1px dotted #ccc;margin:1em 0;clear:both;">'."\n\n"; | |
print_r($thevar); | |
if (is_object($thevar)) | |
{ | |
echo "\n\nmethods on this object"; | |
print_r(get_class_methods($thevar)); | |
} |
quick search of commit messages (and showing hash) with certain word
search = !sh -c 'git log --grep=$1 --pretty=format:\"%h%C(bold yellow) %s%C(reset)\"' -
$ git search wax // e.g. list out all commits that contain "wax" in message
export last X commits showing just commit message and files touched
whatup = !sh -c 'git whatchanged --pretty=format:%n%s --name-only -$1 > /w/logs/git.log' -
<!DOCTYPE html><html><head><meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="" /> | |
<link rel="author" href="" /> | |
<link rel="alternate" type="application/rss+xml" title="" href="" /> | |
<link rel="canonical" href="" /> | |
<meta name="description" content="" /> | |
<meta name="author" content="" /> | |
<meta name="generator" content="" /> | |
<meta name="dcterms.rightsHolder" content="" /> |
/** | |
* Create and save image from Base 64 string | |
* | |
*/ | |
public function generate_image($base64_string, $save_location) | |
{ | |
$gen_image = imagecreatefromstring(base64_decode($base64_string)); | |
if ($gen_image !== false) | |
{ | |
imagejpeg($gen_image, $save_location); |
/** | |
* Render text with possible markup into snippet of plain text chunk | |
* suitable for meta description tag or other display area that | |
* may not like HTML tags or Markdown formatting. | |
* | |
* @author Soon Van - randomecho.com | |
* @copyright 2013 Soon Van | |
* @license http://www.opensource.org/licenses/BSD-3-Clause | |
* | |
* @param string raw text with possible formatting |
Bloody hell is Ruby on Rails development on Windows an exercise in chasing through search engines.
"database configuration does not specify adapter" error with PG gem in Rails 3.2
<?php | |
/** | |
* Database hookup for wrapping around PDO | |
* | |
* @author Soon Van - randomecho.com | |
* @copyright 2013 Soon Van | |
* @license http://www.opensource.org/licenses/BSD-3-Clause | |
*/ | |
class DB { |