Skip to content

Instantly share code, notes, and snippets.

View rjmackay's full-sized avatar

Robbie Mackay rjmackay

View GitHub Profile
@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 / 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 / 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 / api.forms.feature
Last active December 15, 2015 05:39
Snippets for Ushahidi v3 blog post
Scenario: Listing All Forms
Given that I want to get all "Forms"
When I request "/forms"
Then the response is JSON
And the response has a "count" property
And the type of the "count" property is numeric
Then the response status code should be 200
@rjmackay
rjmackay / secfix-2013-001-themes-default.diff
Created April 23, 2013 22:53
Theme changes for security fix 2013-001
diff --git a/themes/default/css/style.css b/themes/default/css/style.css
index f0ff34f..bb97676 100644
--- a/themes/default/css/style.css
+++ b/themes/default/css/style.css
@@ -2126,3 +2126,10 @@ div.ci_checkin {
.user-color { width:160px;height:20px; }
.badges { float:left;padding-left:25px;width:275px;}
.badge img { margin:5px; }
+
+.allowed-html {
@rjmackay
rjmackay / main.js
Created June 12, 2013 01:10
Mapbox + requirejs example
requirejs.config({
shim: {
'http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js': {
exports: 'L'
}
}
});
require(["http://api.tiles.mapbox.com/mapbox.js/v1.0.2/mapbox.js"], function(mapbox) {
@rjmackay
rjmackay / Util_Tile.php
Last active May 31, 2019 04:36
Tile utility class Handles converting slippy map tile numbers to lat/lon values Ported from: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Java
<?php
/**
* Tile utility class
*
* Handles converting slippy map tile numbers to lat/lon values
* Ported from:
* http://svn.openstreetmap.org/applications/routing/pyroute/tilenames.py
* http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Java
*/
class Util_Tile {
@rjmackay
rjmackay / gitdeploy.sh
Last active August 29, 2015 14:00
v3.ushahididev.com Deploy Script
#!/bin/bash
cd /srv/www/ushahidiv3/public_html/
printf "~ Pulling from git\n\n"
git fetch
git checkout .
git reset --hard origin/master
#git status
printf "\n~ Syncing Submodules\n\n"
git submodule sync
@rjmackay
rjmackay / export.py
Created September 4, 2014 22:48
Export photos from twitpic
# Based on http://shkspr.mobi/blog/2013/08/exporting-twitpic-images-python/
# Modified to clean up filename
import urllib
import urllib2
import json
import collections
import HTMLParser
import time
import os
@rjmackay
rjmackay / requirements.txt
Created November 18, 2014 20:39
Milestone Board
phabricator==0.4.0
trello==0.9.1