Skip to content

Instantly share code, notes, and snippets.

@sserbest
sserbest / remove-genesis-entry-title-link.php
Last active September 1, 2015 16:15 — forked from joshuadavidnelson/remove-genesis-entry-title-link.php
Use this code to remove or customize the entry title for a specific post type.
<?php
/**
*
* Remove Links from Post Titles in Genesis
*
* @author Joshua Nelson
* @link http://joshuadnelson.com
*
*/
@sserbest
sserbest / ffmpeg1.txt
Created August 4, 2016 14:11
How To Install FFmpeg on CentOS 6 in cPanel share env.
DOWNLOAD MODULES
cd /root
wget http://dl.fedoraproject.org/pub/epel...1.el6.i686.rpm
rpm -Uvh yasm-1.2.0-1.el6.i686.rpm
cd /usr/local/src
wget http://easynews.dl.sourceforge.net/s...-3.99.5.tar.gz
wget http://downloads.xiph.org/releases/o...g-1.3.1.tar.gz
@sserbest
sserbest / ffmpeg2.txt
Created August 4, 2016 14:13
Install FFmpeg and ffmpeg-php on CentOS Easily
FFmpeg is an amazing collection of open-source tools that can record and stream video and audio. However, it can also transcode video and audio (convert the files to different formats), and that is what has me so excited. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. Today, I’m going to see if I can’t help you get both of these set up on your system.
Admittedly, it’s been a while since I’ve tried to install FFmpeg, about two years. I recently thought up some ideas on how I’d like to use FFmpeg, so I thought it was time to give it a try yet again. Today, I’m proud to say that installing FFmpeg is so much easier to install compared to the past, that I dare say it’s simple.
Here is my experience with installing FFmpeg on my server and how to fix the pitfalls that I encountered.
Preface
Note that I did all the following steps on a CentOS server. The specific version is CentOS x64 5.2.
@sserbest
sserbest / index.html
Created June 26, 2017 02:07
Infinite scroll with scrollspy
<div class="uk-container uk-container-center" style="min-height:600px">
<h1>Infinite list</h1>
<ul class="uk-list uk-list-line" id="infinite-list"></ul>
<div id="scrollspy" data-uk-scrollspy="{topoffset: 200, repeat: true}" class="uk-text-center">
<i class="uk-icon-refresh uk-icon-spin uk-hidden"></i>
</div>
<script type="text/listtemplate">
@sserbest
sserbest / index.php
Created June 30, 2017 15:45
PHP CORS
public function __construct()
{
parent::__construct();
//CORS don't remove
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if($method == "OPTIONS") {
@sserbest
sserbest / readme.md
Last active June 30, 2017 17:30
How to Install FFMPEG on CentOS 7

#Install EPEL repo

yum -y install epel-release
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y install ffmpeg ffmpeg-devel

#check version

ffmpeg
@sserbest
sserbest / readme.md
Created June 30, 2017 20:14
Changing Primary folder on Cpanel

For changing the main/primary domain, you will need to have root SSH access and be able to locate and edit the following file (replacing your user & domain info):

/var/cpanel/userdata/USERNAME/DOMAIN.COM
  1. Once you have opened the file, look for the following line:
documentroot: /home/USERNAME/public_html
@sserbest
sserbest / readme.md
Created June 30, 2017 20:17
.htaccess non-www to www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC]
RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]
@sserbest
sserbest / readme.md
Created July 7, 2017 15:52
Open SSH login on Cpanel

server's /etc/ssh/sshd_config:

To enable password authentication, uncomment

#PasswordAuthentication yes

To enable root login, uncomment

#PermitRootLogin yes
@sserbest
sserbest / app.js
Created September 15, 2017 19:53
Automatically Scroll To Top Of Page With UI-Router In AngularJS
angular.module("app",[
'ngRoute',
'ui.router',
'ngMaterial',
'ngSanitize',
'ngCookies'
])
.config(function($stateProvider, $urlRouterProvider,$locationProvider,$uiViewScrollProvider){
$uiViewScrollProvider.useAnchorScroll();
})