Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
@iamkingsleyf
iamkingsleyf / my.cnf-2GB
Last active August 29, 2015 14:16 — forked from sr75/my.cnf
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
<?php
//checking if the function exist to avoid conflicts
if (function_exists('get_rocket_cdn_url')){
?>
<img class="logo" src="<?php echo get_rocket_cdn_url (get_option('logo_url') );?>"/>
<?php } ?>
@iamkingsleyf
iamkingsleyf / apps.js
Created April 30, 2015 20:23
This is a status update box tutorial i learnt on Codecademy
var main = function () {
$('.btn').click(function() {
var post = $('.status-box').val();
$('<li>').text(post).prepenTo('.posts');
$('.status-box').val('');
$('.counter').text('140');
$('.btn').addClass('disabled');
});
$('.status-box').keyup(function() {
// Add custom post types - events and books to main RSS feed.
function mycustomfeed_cpt_feed( $query ) {
if ( $query->is_feed() )
$query->set( 'post_type', array( 'post', 'events', 'gallery', 'songs', 'videos', 'artists' ) );
return $query;
}
add_filter( 'pre_get_posts', 'mycustomfeed_cpt_feed' );
// Add custom post types - events and books to main RSS feed.
function mycustomfeed_cpt_feed( $query ) {
if ( $query->is_feed() )
$query->set( 'post_type', array( 'post', 'events', 'gallery', 'songs', 'videos', 'artists' ) );
return $query;
}
add_filter( 'pre_get_posts', 'mycustomfeed_cpt_feed' );
'post', 'events', 'gallery', 'songs', 'videos', 'artists'
@iamkingsleyf
iamkingsleyf / custom_posttype_glance.php
Last active August 29, 2015 14:27 — forked from feryardiant/custom_posttype_glance.php
Adding Custom post type counts in 'Right now' Dashboard widget in Wordpress 3.8 or above
<?php
/**
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* - https://core.trac.wordpress.org/ticket/26571
* - https://core.trac.wordpress.org/ticket/26495
* now you can't use 'right_now_*' action API to show your custom post type count from your Dashboard.
* But if you running WP 3.8 or above, you can use 'dashboard_glance_items' instead.
*
* @package Wordpress
@iamkingsleyf
iamkingsleyf / gist:2a1c2be769c0af1e0faf
Last active August 29, 2015 14:27 — forked from evansolomon/gist:2274120
nginx WordPress multisite config
server {
listen 80 default_server;
server_name domain.com *.domain.com;
root /srv/www/domain.com/public;
access_log /srv/www/domain.com/log/access.log;
error_log /srv/www/domain.com/log/error.log;
location / {
index index.php;
@iamkingsleyf
iamkingsleyf / nginx-latest.sh
Last active August 29, 2015 14:27 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list