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
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
<?php
// requires php5
define('UPLOAD_DIR', 'images/');
$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.png';
$success = file_put_contents($file, $data);
<?php
class ImageManipulator
{
/**
* @var int
*/
protected $width;
/**
* @var int
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@otengkwame
otengkwame / gallery.php
Created March 25, 2017 06:23 — forked from kokers/gallery.php
ACF Pagination Gallery with categories
@otengkwame
otengkwame / Base.php
Created March 25, 2017 06:29 — forked from jlamim/Base.php
ChartJS + CodeIgniter
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Classe base para o exemplo
*
*/
class Base extends CI_Controller {
/**
* Método para carregamento da página principal
@otengkwame
otengkwame / artisan.php
Created July 6, 2017 01:06 — forked from vkbansal/artisan.php
Tying to use artisan migrate commands outside laravel
<?php
require_once "vendor/autoload.php";
use Symfony\Component\Console\Application;
use Illuminate\Database\Console\Migrations;
use Pimple\Container;
$container = new Container();
$container['migration-table'] = 'migration';
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['views_paths'] = array(
APPPATH . 'views/'
);
$config['cache_path'] = APPPATH . 'cache/blade/';
<?php
$arr = array(1, 2, 3);
/**
* PHP Weirdness 1
* 'continue' acts like 'break' inside of a switch statement when inside of a loop
* whereas 'continue' acts as expected inside an elseif block
*/
foreach ($arr as $item) {
switch($item) {
@otengkwame
otengkwame / contact.html
Created December 22, 2017 06:19 — forked from ajtroxell/contact.html
Build a simple PHP, jQuery, and AJAX Powered Contact Form, from: http://ajtroxell.com/build-a-simple-php-jquery-and-ajax-powered-contact-form/
<form id="contact" name="contact" method="post">
<fieldset>
<label for="name" id="name">Name<span class="required">*</span></label>
<input type="text" name="name" id="name" size="30" value="" required/>
<label for="email" id="email">Email<span class="required">*</span></label>
<input type="text" name="email" id="email" size="30" value="" required/>
<label for="phone" id="phone">Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" />