Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

<?php
// rewrite /wp-content/themes/theme-name/css/ to /css/
// rewrite /wp-content/themes/theme-name/js/ to /js/
// rewrite /wp-content/themes/theme-name/img/ to /img/
// rewrite /wp-content/plugins/ to /plugins/
function roots_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
@ikennaokpala
ikennaokpala / number_page_avoid_cover.js
Last active August 29, 2015 14:22
Wicked PDF page numbering
function number_page_avoid_cover() {
var vars={};
var x=document.location.search.substring(1).split('&');
for(var i in x) {
var z=x[i].split('=',2);
if (z[0] =='page' && z[1]==1) {
vars[z[0]] = 0
} else {
vars[z[0]] = unescape(z[1]-1);
@ikennaokpala
ikennaokpala / database.yml.example mysql2
Last active August 29, 2015 14:26 — forked from erichurst/database.yml.example mysql2
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@ikennaokpala
ikennaokpala / .pryrc
Last active August 29, 2015 14:26
Pry gem development set up
before_session = Proc.new do |out, target, _pry_|
(Dir["**/lib/**/*.rb"]+Dir["**/spec/**/*.rb"]).each do |path|
$: << path unless !File.exist?(path) || $:.include?(path)
end
end
Pry.config.hooks.add_hook(:before_session, before_session) do
puts "Welcome to primes debug session"
end
@ikennaokpala
ikennaokpala / my.cnf
Last active September 16, 2015 20:47
my.cnf for galera
[mysqld]
### mysql general option
bind-address = 0.0.0.0
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
@ikennaokpala
ikennaokpala / login.js
Created February 13, 2011 14:14
Login status switch with Jquery Ajax
$(document).ready(function(){
$.each($.browser, function(i, val) {
if(i=="mozilla")
// alert("Ikenna Do stuff for firefox 3 Now now")
$('#header').before('<br/><br/>');
});
$("#loading").ajaxStart(function(){
$(this).append("<p><img src='/images/ajax-loader-2.gif' border='0' align='center' /></p>");
@ikennaokpala
ikennaokpala / countries.js
Created February 22, 2011 15:25
Countries Drop down
var all_countries = ['---Select a country---','United Kingdom','United States','Canada', 'Austria', 'Belgium', 'Bulgaria', 'Cyprus', 'Czech Republic', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', 'Greece', 'Hungary', 'Italy', 'Latvia', 'Lithuania', 'Luxembourg', 'Malta', 'Netherlands', 'Poland', 'Portugal', 'Romania', 'Slovakia', 'Slovenia', 'Spain', 'Sweden', 'Honduras','El Salvador','Haiti','Jamaica', 'Guyana','Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Australia', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belize', 'Benin', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'Brunei Darussalam', 'Burkina Faso', 'Burma', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Central African Republic', 'Chad', 'Chile', 'China', 'Colombia', 'Comoros', 'Congo', 'Democratic Republic of the Congo', 'Costa Rica', 'Côte d\'Ivoire', 'Croatia', 'Cuba', 'Djibouti', 'Dominica', 'Dominican Republ
-- DELIMITER $$
DELIMITER $$
-- DROP PROCEDURE IF EXISTS UPDATE_COL_COUNT $$
DROP PROCEDURE IF EXISTS UPDATE_COL_COUNT $$
CREATE PROCEDURE UPDATE_COL_COUNT(NEW_TAXO_ID INTEGER, NEW_COUNT INTEGER)
BEGIN
SET @dyn_sql=CONCAT(
'UPDATE ' , 'WP_TERM_TAXONOMY',
' SET ' , 'COUNT', ' = ?
WHERE ' , 'TERM_TAXONOMY_ID', ' = ?');