Skip to content

Instantly share code, notes, and snippets.

View aslamdoctor's full-sized avatar
💭
Always working but happy to talk 👍

Aslam Doctor aslamdoctor

💭
Always working but happy to talk 👍
View GitHub Profile
@aslamdoctor
aslamdoctor / convertmp4_to_ogg_webm.txt
Created November 9, 2017 10:16
Convert mp4 to ogv and/or WebM
# Convert mp4 video to ogv and/or WebM
# Browser support:
# http://caniuse.com/#search=mp4
# http://caniuse.com/#search=ogv
# http://caniuse.com/#search=webm
# Installation:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with- --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
@aslamdoctor
aslamdoctor / encoding-video.md
Created April 8, 2018 10:19 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@aslamdoctor
aslamdoctor / mysqldump_pre_commit_hook.bash
Created August 7, 2018 13:22 — forked from nuclearsandwich/mysqldump_pre_commit_hook.bash
A pre-commit hook for git which dumps and adds a mysql database to the repository just before commit.
#!/bin/bash
# Pre-commit hook to make a mysql dump right before committing and add it to the commit.
#
## Change the following values to suit your local setup.
# The name of a database user with read access to the database.
DBUSER=root
# The password associated with the above user. Leave commented if none.
#DBPASS=seekrit
# The database associated with this repository.
DBNAME=dplay
@aslamdoctor
aslamdoctor / Staging&ProductionUsingGit
Created August 7, 2018 13:34 — forked from mediabeastnz/Staging&ProductionUsingGit
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com
@aslamdoctor
aslamdoctor / EloquentCheatSheet.md
Created December 27, 2019 04:21 — forked from avataru/EloquentCheatSheet.md
Laravel : Eloquent relationships cheat sheet
@aslamdoctor
aslamdoctor / ContextCmder-Disable.reg
Created February 7, 2020 16:48 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@aslamdoctor
aslamdoctor / php-chmod
Last active September 10, 2022 12:49 — forked from jasperf/php-chmod
PHP Script to change file and folder permissions
<?php
//http://www.webhostingtalk.com/showthread.php?t=218863
$start_dir = 'whatever'; // Starting directory no trailing slashes.
$perms['file'] = 0644; // chmod value for files don't enclose value in quotes.
$perms['folder'] = 0755; // chmod value for folders don't enclose value in quotes.
function chmod_file_folder($dir) {
global $perms;
$dh=@opendir($dir);
@aslamdoctor
aslamdoctor / youtube_id_from_url.php
Created October 11, 2021 15:51 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );