Skip to content

Instantly share code, notes, and snippets.

View kn9ts's full-sized avatar
🌠
I am one with the force!

Eugene Mutai kn9ts

🌠
I am one with the force!
View GitHub Profile

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
<?php
class EpaymentsRedirectorPage extends RedirectorPage {
private static $db = array(
"IconColor" => "Text",
"IconType" => "Text"
);
private static $singular_name = 'Epayments Redirector Page';
public function PaginatedPages() {
$blogHolderId = $this->ID;
$list = BlogEntry::get()->filter(array("ParentID" => "{$blogHolderId}"))->sort('Date DESC');
$paginatedItems = new PaginatedList($list, $this->request);
$paginatedItems->setPageLength(4);
return $paginatedItems;
}
@kn9ts
kn9ts / mistreated.js
Created February 21, 2015 12:39
Friends do not mistreat friends algorithmn
/**
*@Author - Eugene Mutai
*@Twitter - Jheneknights
*@Email - eugenemutai@gmail.com
*
* Date: 21/03/14
* Time: 2:00 pm
*
*/
@kn9ts
kn9ts / login.html
Created February 21, 2015 13:11
A Login form powered by AngularJS directives [Form Validation]
<!-- SPLASH: LOGIN PAGE -->
<section id="signup-login" data-transition="slide">
<article class="active splash">
<img src="./images/html5logos/white.png" class="logo">
<div class="form">
<form name="signup" novalidate ng-submit="signIn(signup)">
<fieldset class="radius-top" data-icon="user">
<input type="text" name="fullNames" ng-model="fullNames" ng-pattern="/^[\w]+(\s)[\w]+$/" ng-class="{'error': !signup.fullNames.$valid}" placeholder="Your username" id="txt-signup-name" value="" required>
</fieldset>
<fieldset class="radius-bottom shadow" data-icon="phone">

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

@kn9ts
kn9ts / nairobijs-welcome-console-log.js
Created April 12, 2015 15:06
Nairobi JS welcome console log message
console.log('%cNairobi', 'background: #FFDE00; color: #555; font-weight: bolder; font-size: 50px; padding: 5px 40px; solid #FFDE00;');console.log('%cJS', 'background: #FFDE00; color: #555; font-weight: bolder; font-size: 200px; padding: 0px 25px; solid #FFDE00;')
@kn9ts
kn9ts / abacus-charts.directive.js
Created April 16, 2015 13:45
My 1st directive, was challenging, saving the neat tricks used in here, grabbing attribute data, and waiting for data from the servers and passing them to external function. Awesome angular!!
// ==================== Gainers Directive =======================
appEngine.directive('agCharts', function($chartDefaults) {
return {
restrict: 'E',
// <ag-charts chart-id="[[co_gain.id ]]" options="[[ co_gain.options ]]"></ag-charts>
scope: {
chartId: '@',
chartType: '@',
years: '@',
months: '@'
@kn9ts
kn9ts / index.html
Created April 27, 2015 09:55
html5 boilerplate
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">