Skip to content

Instantly share code, notes, and snippets.

View dkobia's full-sized avatar

David Kobia dkobia

View GitHub Profile
$(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 / submit_edit_js.diff
Last active December 24, 2015 07:19
This is untested, but its a diff for /themes/default/views/reports/submit_edit_js.php. You need to use Google Maps instead of OpenStreetMap.
diff --git a/themes/default/views/reports/submit_edit_js.php b/themes/default/views/reports/submit_edit_js.php
index 507195e..2ea862e 100755
--- a/themes/default/views/reports/submit_edit_js.php
+++ b/themes/default/views/reports/submit_edit_js.php
@@ -676,43 +676,49 @@
*/
function geoCode()
{
- $('#find_loading').html('<img src="<?php echo url::file_loc('img')."media/img/loading_g.gif"; ?>">');
- address = $("#location_find").val();
/**
* Google GeoCoder
*/
function geoCode()
{
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
// Clear the map first
@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/
/*! normalize.css v2.1.1 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{background:#fff;color:#000;font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px
<?php defined('SYSPATH') OR die('No direct access allowed.');
return array(
'auth' => MODPATH.'auth', // Basic authentication
'cache' => MODPATH.'cache', // Caching with multiple backends
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
'database' => MODPATH.'database', // Database access
//'image' => MODPATH.'image', // Image manipulation
'orm' => MODPATH.'orm', // Object Relationship Mapping
'unittest' => MODPATH.'unittest', // Unit testing
<?php
public function action_email()
{
$this->template = '';
$this->auto_render = FALSE;
$this->template->content = View::factory('email/layout');
}
<?php
public function action_email()
{
$this->template = '';
$this->auto_render = FALSE;
// Use App's Email Setup to Send Mail
$driver = PingApp_Settings::get('email_outgoing_type');
$options = array(
@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
2014-05-05 11:06:56.251 Ushahidi[7573:60b] -[USHDatabase managedObjectModel] [Line 241] Bundle Exists: /Users/david/Library/Application Support/iPhone Simulator/7.1/Applications/E95E636C-3118-42E4-B751-7927B7548E0F/Ushahidi.app/Ushahidi.bundle
2014-05-05 11:06:56.252 Ushahidi[7573:60b] -[USHDatabase managedObjectModel] [Line 249] Resource Exists: /Users/david/Library/Application Support/iPhone Simulator/7.1/Applications/E95E636C-3118-42E4-B751-7927B7548E0F/Ushahidi.app/Ushahidi.bundle/Ushahidi.momd/Ushahidi.mom
2014-05-05 11:06:56.252 Ushahidi[7573:60b] -[USHDatabase managedObjectModel] [Line 255] Resource URL:file:///Users/david/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/E95E636C-3118-42E4-B751-7927B7548E0F/Ushahidi.app/Ushahidi.bundle/Ushahidi.momd/Ushahidi.mom
2014-05-05 11:06:56.257 Ushahidi[7573:60b] -[USHDatabase persistentStoreCoordinator] [Line 268] Database file:///Users/david/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/E95E636C-3118-42E4-B751-7927B7548E0F