Skip to content

Instantly share code, notes, and snippets.

View rjmackay's full-sized avatar

Robbie Mackay rjmackay

View GitHub Profile
@rjmackay
rjmackay / query.sql
Created November 14, 2012 23:52
OVL default location query
SELECT incident.id,
incident.location_id,
location.id,
location.latitude,
location.longitude,
form_response.incident_id,
form_response.form_response,
form_response.form_field_id
FROM incident INNER JOIN location ON incident.location_id = location.id
INNER JOIN form_response ON incident.id = form_response.incident_id
@rjmackay
rjmackay / main_js.php.diff
Created October 12, 2012 01:51
Ushahidi JS Diff
diff --git a/themes/default/views/main/main_js.php b/themes/default/views/main/main_js.php
index 3254b58..05c479f 100644
--- a/themes/default/views/main/main_js.php
+++ b/themes/default/views/main/main_js.php
@@ -210,7 +210,7 @@ jQuery(function() {
name: "<?php echo Kohana::lang('ui_main.reports'); ?>",
url: reportsURL,
transform: false
- }, true);
+ }, true, true);
@rjmackay
rjmackay / php.conf
Created October 7, 2012 05:08
Example Ushahidi nginx vhost config
fastcgi_split_path_info ^(.*\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTP_HOST $host;
fastcgi_param SERVER_NAME $host;
fastcgi_intercept_errors on;
fastcgi_index index.php;
@rjmackay
rjmackay / ushahidi_cron
Created September 5, 2012 01:31
Ushahidi Cron runner
#!/bin/bash
# Ushahidi cron script
if [ $# -lt 2 ] ; then
echo "Usage: ushahidi_cron [docroot] [baseurl]"
exit 1
fi
DOCROOT=$1
BASEURL=$2
LOCK_ID=`echo $BASEURL | sed -r -e "s#http[s]{0,1}://##g"`
@rjmackay
rjmackay / Request
Created September 3, 2012 22:44
HTTP Response/Request when registering for crdmp3
POST /v1/session/register/ HTTP/1.1
Host: api.crdmp3.com
Content-Length: 94
Origin: http://crdmp3.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: application/json, text/javascript, */*; q=0.01
Referer: http://crdmp3.com/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
@rjmackay
rjmackay / gist:3521794
Created August 30, 2012 02:26
Ushahidi Reports API request
POST /api?task=report HTTP/1.1
Host: ushahidi.robbiemackay.com
Content-Length: 1177
Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
Authorization: Basic cm9iYmllQHVzaGFoaWRpLmNvbTpFdjQ5WEpaTGRzeDBKNTg=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.82 Safari/537.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBvVUFzEtkUIBzPxE
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
@rjmackay
rjmackay / gdk-pixbuf-2.26.2.og
Created August 20, 2012 05:33
Output from brew install -v gdk-pixbuf
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.26/gdk-pixbuf-2.26.2.tar.xz
Already downloaded: /Users/robbie/Library/Caches/Homebrew/gdk-pixbuf-2.26.2.tar.xz
xz -dc "/Users/robbie/Library/Caches/Homebrew/gdk-pixbuf-2.26.2.tar.xz" | /usr/bin/tar xf -
==> ./configure --disable-dependency-tracking --disable-maintainer-mode --enable-debug=no --prefix=/usr/local/Cellar/gdk-pixbuf/2.26.2 --with-libjasper --enable-introspection=no --disable-Bsymbolic --without-gdiplus
./configure --disable-dependency-tracking --disable-maintainer-mode --enable-debug=no --prefix=/usr/local/Cellar/gdk-pixbuf/2.26.2 --with-libjasper --enable-introspection=no --disable-Bsymbolic --without-gdiplus
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
@rjmackay
rjmackay / upgrade65-66.sql
Created August 8, 2012 05:36
upgrade65-66.sql
ALTER TABLE `settings` ADD `allow_alerts` tinyint(4) NOT NULL DEFAULT '0';
UPDATE `settings` SET `db_version` = '66' WHERE `id`=1 LIMIT 1;
@rjmackay
rjmackay / category_wildlife_block.php
Created August 8, 2012 02:14
Ushahidi Category Blocks
<?php blocks::open("reports");?>
<?php blocks::title(Kohana::lang('ui_main.reports_listed'));?>
<table class="table-list">
<thead>
<tr>
<th scope="col" class="title"><?php echo Kohana::lang('ui_main.title'); ?></th>
<th scope="col" class="location"><?php echo Kohana::lang('ui_main.location'); ?></th>
<th scope="col" class="date"><?php echo Kohana::lang('ui_main.date'); ?></th>
</tr>
</thead>
@rjmackay
rjmackay / gen_update.sh
Created July 25, 2012 21:27
Gen update with commandline params
#!/bin/bash
# To check tags, run this in the browser
# https://api.github.com/repos/ushahidi/Ushahidi_Web/tags
if [[ $# -lt 2 ]]
then
echo "Usage: gen_updates.sh [previous-tag] [current-tag]"
exit 1
fi