Skip to content

Instantly share code, notes, and snippets.

View dkobia's full-sized avatar

David Kobia dkobia

View GitHub Profile
<?php
$hex1 = 'FF0000';
$hex2 = '0000FF';
$hex3 = '';
$r1 = base_convert($hex1{0}.$hex1{1},16,10);
$g1 = base_convert($hex1{2}.$hex1{3},16,10);
$b1 = base_convert($hex1{4}.$hex1{5},16,10);
$r2 = base_convert($hex2{0}.$hex2{1},16,10);
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Election Tool Hook - Load All Events
*
* PHP version 5
* LICENSE: This source file is subject to LGPL license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/copyleft/lesser.html
* @author Ushahidi Team <[email protected]>
* @package Ushahidi - http://source.ushahididev.com
@dkobia
dkobia / gist:1233483
Created September 21, 2011 22:18 — forked from avalanche123/gist:981817
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@dkobia
dkobia / numbers
Last active December 19, 2015 05:39 — forked from kamaulynder/numbers
51409,
51410,
13468,
13469,
54608,
47151,
9974,
8186,
43756,
7461,
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
@dkobia
dkobia / app.js
Created August 21, 2013 15:18 — forked from minhnc/app.js
var ai = require('ui').activityIndicator();
var win = Ti.UI.createWindow();
win.add( ai );
ai._show({message: 'Loading...'});
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function() {
ai._hide();
}
xhr.onerror = function() {
$(document).ready(function() {
openid.init('openid_identifier');
openid.setDemoMode(false);
<?php
// Depending on the action, we need to display forms by default
if ($action == "signin" OR $action == "forgot")
{
echo '$("#signin_userpass").hide(400);';
@dkobia
dkobia / README.md
Last active December 24, 2015 17:59 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /srv/www/html/
    • your webpages are executed by nginx
  • nginx's home directory is /srv/www/
@dkobia
dkobia / php-resque
Created November 13, 2013 22:07 — forked from evopix/php-resque
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: php-resque
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: resque - a Redis-backed PHP library for creating background jobs
@dkobia
dkobia / clamav-mac.md
Last active February 7, 2017 20:41 — forked from Uchean/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so