Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
//ibnesayeed/faye
var http = require('http'),
faye = require('faye'),
port = Number(process.env.PORT) || 9292,
timeout = Number(process.env.TIMEOUT) || 45,
mount = process.env.MOUNT || '/faye';
var server = http.createServer(),
bayeux = new faye.NodeAdapter({mount: mount, timeout: timeout});
@ikennaokpala
ikennaokpala / cloudflare.conf
Created January 11, 2016 07:38 — forked from CodySwannGT/cloudflare.conf
WordPress/Nginx/PHP/Varnish Configuration
# /etc/nginx/cloudflare.conf
# If using Cloudflare, uncomment the following to get proper originating IPs
#set_real_ip_from 204.93.240.0/24;
#set_real_ip_from 204.93.177.0/24;
#set_real_ip_from 199.27.128.0/21;
#set_real_ip_from 173.245.48.0/20;
#set_real_ip_from 103.22.200.0/22;
#set_real_ip_from 141.101.64.0/18;
#real_ip_header CF-Connecting-IP;
@ikennaokpala
ikennaokpala / install_puma_gem.sh
Last active April 14, 2018 10:51
install puma gem on el capitan
brew install openssl
brew link --force openssl
gem install puma
ALternatively:
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
gem install puma
@ikennaokpala
ikennaokpala / gist:fb137f287ffaa21784c0
Created December 2, 2015 01:12 — forked from shaundomingo/gist:43a32b72904d89f90d58
CoreOS in anger - deploying a scalable wordpress cluster on CoreOS with fleet, docker and vulcand

CoreOS can seem daunting at first. This tutorial is built to encourage you in your journey and to demonstrate the power of this minimalistic operating system.

Exercise 1: Boot up a 3 machine coreos cluster

1a: Install prerequisite software

1b: Clone the coreos-vagrant repo

@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 / .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 / 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 / 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);
<?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();
}