This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.geneticcoder.Versionator; | |
// Check here for updates: https://gist.github.com/Pamblam/53cb2b1c90dea09d4872084956d17b5c | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import android.os.AsyncTask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A disposable alert modal that uses Bootstrap | |
* https://jsfiddle.net/s9ojmwwt/2/ | |
*/ | |
function BSAlert(text){ | |
var mid = "modal"+Math.floor(Math.random() * 10000000000000001); | |
var html = '<div class="modal fade" id="'+mid+'" tabindex="-1"'+ | |
'role="dialog" aria-labelledby="myModalLabel" aria-hidden='+ | |
'"true"><div class="modal-dialog"><div class="modal-conten'+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.package.name; | |
import android.app.AlertDialog; | |
import android.content.ActivityNotFoundException; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.SharedPreferences; | |
import android.net.Uri; | |
import android.util.Log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
// Create the return array | |
$return = array( | |
"response" => "Success", | |
"success" => true, | |
"data" => array() | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Format a date using PHP date shorthand | |
* @param {Date} date - A Javascript Date object | |
* @param {String} format - The format of the outputted date | |
* @returns {String} - The formatted date | |
*/ | |
function formatDate(date, format) { | |
if (isNaN(date.getTime())) return "Invalid Date"; | |
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Makes an HTTP request via GET or POST, and can download a file | |
* @returns - Returns the response of the request | |
* @param $url - The URL to request, including any GET parameters | |
* @param $params - An array of POST values to send | |
* @param $filename - If provided, the response will be saved to the | |
* specified filename | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Given a string of PHP code, this will provide a list of classes, their | |
* constructors and the line number they're on. Used for programmatically | |
* updating older code using PHP4 style constructors to PHP7 | |
*/ | |
class classParser{ | |
private $code; | |
private $tokens = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert an Oracle SYS.SDO_GEOMETRY definition (perhaps extracted from an insert | |
* statement) to a MySQL Geometry column. This function only handles Polygons and | |
* Multipolygons. | |
* | |
* Example: | |
* $definition = "MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-75.01703,41.79308,-75.02978,41.7941,-75.02735,41.772,-75.02716,41.77193,-75.02697,41.77187,-75.01354,41.79051,-75.01337,41.79061,-75.0132,41.79072,-75.00949,41.79234,-75.00946,41.79254,-75.00943,41.79274,-75.00518,41.7943,-74.9995,41.79178,-74.99365,41.79788,-74.99383,41.79798,-74.99876,41.80318,-74.9988,41.80337,-74.99883,41.80349,-75.00425,41.80479,-75.00431,41.80459,-75.01239,41.79415,-75.01245,41.79412,-75.01688,41.79345,-75.01696,41.79327,-75.01703,41.79308))"; | |
* $sql = "INSERT INTO mytable (geom) VALUES (".OraclePolygonToMysql($definition).")"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The name of the process to search for and kill | |
PROCESSNAME="oracle"; | |
# Determine if this script is currently running | |
if [ -f omstatus ]; then | |
# The status file exists, wait a second and see if it changes | |
CURRENTSTATUS=$(cat omstatus); sleep 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dynamically cache requests and responses in a single mysql table | |
*/ | |
class RequestCache{ | |
// Configurable Options | |
// The mysql options (except for $mysql_table) may be left blank if a $pdo | |
// connection is passed to the constructor. |
OlderNewer