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 / My_Model.php
Created August 2, 2016 11:18
A CodeIgniter base model to provide basic CRUD actions for all models that inherit from it.
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* A base model to provide basic CRUD actions for all models that inherit
* from it.
* Inspired by Joost van Veen @codeigniter.tv
* Expanded by Me (Oteng Kwame Appiah Nti)
* I think this wil be useful :)
* Note it is not well documented.
*
@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/';
@otengkwame
otengkwame / index.html
Created September 24, 2017 02:48
OxXJKV
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Clock</title>
<link rel="stylesheet" type="text/css" href="public/css/style.css">
</head>
<body>
<div id="wrapper">
<div id="watch">