Skip to content

Instantly share code, notes, and snippets.

View otengkwame's full-sized avatar
💭
Cooking some open source projects

Kwame Oteng Appiah-Nti otengkwame

💭
Cooking some open source projects
View GitHub Profile
@otengkwame
otengkwame / base_url_for_ci.txt
Last active August 27, 2018 16:56 — forked from onubadev/gist:3ba272d8cee68dcc49892d22e7bac4fd
Codeigniter dynamic HTTP/HTTPS base url
#in config.php
$base_url=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST'];
$base_url.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $base_url;
@otengkwame
otengkwame / gist:ed1ef935d5812909e6236f01005cc12e
Created August 28, 2018 19:14 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@otengkwame
otengkwame / Email Server (Linux, Unix, Mac).md
Created September 2, 2018 20:58 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only Email Server (Linux, Unix, Mac)

Setup a Local Only Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@otengkwame
otengkwame / vuejs-php.md
Created September 2, 2018 22:03 — forked from happygrizzly/vuejs-php.md
VueJs and PHP

VueJs and PHP

Setup

First test

@otengkwame
otengkwame / vuejs-php.md
Created September 2, 2018 22:03
VueJs and PHP
<ul>
<li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-leadguitar.mp3">Lead Guitar</a></li>
<li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-drums.mp3">Drums</a></li>
<li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-bassguitar.mp3">Bass Guitar</a></li>
<li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-horns.mp3">Horns</a></li>
<li><a class="track" href="http://jPlayer.org/audio/mp3/gbreggae-clav.mp3">Clavi</a></li>
</ul>
@otengkwame
otengkwame / bootstrap-nav-profile-pic.css
Created December 21, 2018 03:05 — forked from matthewhartstonge/bootstrap-nav-profile-pic.css
Bootstrap 3 Navbar Profile CSS with HTML Example
/* Bootstrap 3 Navbar Profile Picture CSS
*
* The CSS for profile pictures in the navbar has always annoyed me,
* so here's my fix that appears to have the least hoops.
*
* Production use:
* >Add a div with the specified class.
* >Using JS, change the profile picture CSS URL as needed.
*
* HTML example:
@otengkwame
otengkwame / remove_checkout_fields.php
Created June 17, 2019 16:50 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
@otengkwame
otengkwame / setFolderPerms.sh
Created July 15, 2019 14:28 — forked from jones139/setFolderPerms.sh
CodeIgniter/Bonfire - Set correct file/folder permissions for bonfire admin functions.
#!/bin/sh
# This should be run from the main CI/bonfire directory (the one that contains index.php)
# The writeableFiles list of filenames is relative to the bonfire/application directory.
# You probably need to run this as root for chgrp to work.
# Graham Jones, 08Oct2011
writeableFiles="../modules cache logs config archives db/backups db/migrations config/development config/production config/testing config/application.php config/config.php"
cd bonfire/application
@otengkwame
otengkwame / index.html
Created July 27, 2019 01:59
Week #6 :: Music Player :: RV Code Challenge
<div class="player" data-player data-playlist="boxer" data-track="0">
<div class="player__content">
<div class="player__artist has-fade-in" data-player-album-artist>Tronix</div>
<div class="player__album has-fade-in" data-player-album-name>Sonar</div>
<div class="player__track has-fade-in" data-player-album-song>Mosh Pit</div>
<div class="album album--boxer" data-album>
<div class="album__cover"></div>