Skip to content

Instantly share code, notes, and snippets.

View ibejohn818's full-sized avatar

John Hardy ibejohn818

  • GoDaddy Inc
  • Los Angeles, Ca
View GitHub Profile
<?php
App::uses("AppModel","Model");
class UserPermission extends AppModel {
// PERMISSION STATES
const ALLOWED = true;
const DENIED = false;
@ibejohn818
ibejohn818 / gist:10954133
Last active February 20, 2019 21:16
Compile FFMpeg & Dependencies - RedHat Linux
# run as root!
yum erase ffmpeg faac libfaac x264 libx264 libvpx -y
yum install gcc gcc-c++ automake autoconf libtool nasm git subversion nasm pkgconfig -y
export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
@ibejohn818
ibejohn818 / gist:11223736
Last active August 29, 2015 14:00
Patch PHP & HTML Files
<?php
/*
Will patch code inbtween the following blocks
##@patch:[email protected]
CODE TO BE PATCHED
##@patch:[email protected]
@ibejohn818
ibejohn818 / nmap.php
Created April 29, 2014 20:32
Nmap Quick and Dirty
<?php
class Nmap {
public function __contruct() {
}
@ibejohn818
ibejohn818 / ffmpeg-ec2.sh
Last active August 29, 2015 14:00
FFMPEG AMAZON LINUX
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel -y
mkdir /tmp/ffmpeg
cd /tmp/ffmpeg
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure --prefix=/usr --libdir=/usr/lib64 # or ./configure --prefix=/usr if on a 32-bit machine
make
@ibejohn818
ibejohn818 / jch-todo.md
Last active August 29, 2015 14:01
Stuff i need to do on johnchardy.com
  • User Manager
    • User Permission Interface
    • User Permission Facebook Login
    • Double Check Google Login
    • Check User Group Functions
  • Home Page
  • Images Archive
  • Home Movies
@ibejohn818
ibejohn818 / clear-branches
Last active August 29, 2015 14:01
Delete DTT Local Branches | Will skip master and any branch you are currently on and ask you to delete, or, pass in -y to just delete
#!/usr/bin/env php
<?php
# delete DTT branches
# will go through all repos in /home/websites
# and ask if you want to delete the branch
# will skip master and any branch you are currently on
# pass in -y to skip asking and just delete
###############################################################
@ibejohn818
ibejohn818 / cakeshell
Created June 11, 2014 18:15
Cake 2.X Cakeshell template
#!/usr/bin/env php
<?php
//path to lib/Cake/Console/cake
$cakeShellpath = "";
//path to your default app directory. IE: /home/sites/mysite.com/cake/app
// ( So you don't have to add '--app /myapppath' for every call and if you're hosting multiple cake sites under a single installation)
$defaultAppPath = "";
@ibejohn818
ibejohn818 / jpg-to-pdf.php
Created October 2, 2014 06:30
JPG to PDF
#!/usr/bin/php
<?php
$i = "/mnt/hgfs/johnhardy/Desktop/test.jpg";
$img = new Imagick($i);
$img->setFormat("pdf");
$fh = "/mnt/hgfs/johnhardy/Desktop/test.pdf";
@ibejohn818
ibejohn818 / gist:f3d4f754642e8f7f5875
Created January 17, 2015 05:05
Hide / Show Desktop Icons on Mac OSX
Hide:
defaults write com.apple.finder CreateDesktop -bool false && killall Finder
Show:
defaults write com.apple.finder CreateDesktop -bool true && killall Finder