Skip to content

Instantly share code, notes, and snippets.

View AlexBezuska's full-sized avatar

Alex Bezuska AlexBezuska

  • Louisville, Kentucky (KY)
View GitHub Profile
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
//works on my local machine, white screens the server
echo str_replace( ['<ul>','</ul>'], '', $string );
//works great on both
echo str_replace( array('<ul>','</ul>'), '', $string );
@AlexBezuska
AlexBezuska / google translate beatboxing
Created April 12, 2014 05:39
Sounds for google translate beatboxing
/*
zk
bschk
pv
bk
tk
{
"email": null,
"stripeToken": "1413rffqe3f1e1fwefwert1t1we",
"stripeShippingName": "A Test User",
"stripeShippingAddressLine1": "1we2e12",
"stripeShippingAddressZip": "62650",
"stripeShippingAddressState": "IL",
"stripeShippingAddressCity": "Jacksonville",
"stripeShippingAddressCountry": "United States",
"products": [
@AlexBezuska
AlexBezuska / PHP JSON POST ( using Curl ) Function
Last active August 29, 2015 14:00
with Javascript console error/status reporting
function postJSONtoURL($data, $url, $v=false){
$content = json_encode($data);
if($v){ echo "<script>console.log('JSON you are posting:\\n ".$content."\\n');</script>"; }
if($v){ echo "<script>console.log('URL you are posting to\\n ".$url."\\n');</script>"; }
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
@AlexBezuska
AlexBezuska / gist:e80ccef1464209ae0c53
Created July 2, 2014 13:33
Setup and run multiple ghost blogs
Apache config:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerAlias [your domain or subdomain here]
ProxyPass / http://localhost:2368/
ProxyPassReverse / http://localhost:2368/
</VirtualHost>
@AlexBezuska
AlexBezuska / mysqldump from remote server into git repo
Last active August 29, 2015 14:15
mysql remote server backup script (with git)
#!/bin/sh
SERVER="servername"
USER="username"
PASSWORD="password"
NOW=$(date +"%m-%d-%Y %r")
DB="databasname"
COMMITMSG="mysql dump"
ssh $SERVER "mysqldump --verbose -u $USER --pass=$PASSWORD $DB" > $DB.sql
@AlexBezuska
AlexBezuska / gist:4a37c2dbbb2b1b970853
Created February 20, 2015 01:42
exiftool photo rename script
exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H.%M.%S%%-c.%%e" /dir/
@AlexBezuska
AlexBezuska / gist:3180dd26ade437aa0f14
Created February 20, 2015 16:18
Flatten directory with Gnu CP
if you don't have Gnu copy:
brew install coreutils
Flatten:
Specific file type only
find SOURCE -name '*.mp3' -exec gcp -v --backup=numbered {} DESTINATION \;
All files
find SOURCE -type f -exec gcp -v --backup=numbered {} DESTINATION \;
@AlexBezuska
AlexBezuska / gist:7ed959346898f927a8a2
Last active August 29, 2015 14:18
MySQL CheatSheet
log into mysql
#################################
$ mysql -u root -p
list all databses
#################################
mysql> show databases;
list all users
#################################