Skip to content

Instantly share code, notes, and snippets.

View MorningZ's full-sized avatar

Stephen MorningZ

  • Central Florida
View GitHub Profile
@MorningZ
MorningZ / Appcelerator Titanium "PickerView"
Created April 12, 2011 14:04
Create slide up picker views to give your user a nice way to make choices (for iOS)
/**
* @description: This is the iPhone version to create picker views on the fly :-)
* @author: Stephen G
* @date: 04/11/2011
* @screenshot: http://yfrog.com/h4vr6ep
*
* @thanks to: http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/
*
* Example of use (two different pickers using same function to create):
*
@MorningZ
MorningZ / titanium_zentus_xmlrpc.js
Created May 1, 2011 23:37
Titanium + Zentus XML-RPC for talking to WordPress
/*
* Copyright (c) 2008 David Crawshaw <david@zentus.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@MorningZ
MorningZ / helpful_prototypes.js
Created May 6, 2011 05:16
Helpful JavaScript prototypes!
/*********************************************/
/* Prototypes that work against primitives */
/*********************************************/
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); };
String.prototype.contains = function(t) { return this.indexOf(t) >= 0 ? true : false; };
String.prototype.beginsWith = function(t, i) { if (i == false) { return (t == this.substring(0, t.length)); } else { return (t.toLowerCase() == this.substring(0, t.length).toLowerCase()); } };
String.prototype.endsWith = function(t, i) { if (i == false) { return (t == this.substring(this.length - t.length)); } else { return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase()); } };
Object.prototype.merge = (function (ob) {var o = this;var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) {o[z] = ob[z];}}return o;});
/* Examples:
@MorningZ
MorningZ / convert_xml_to_json.js
Created May 10, 2011 18:30
Function to convert XML data to easier-to-work-with JSON
/*
I take zero credit for this, as it was posted as a comment on this blog post:
http://davidwalsh.name/convert-xml-json
*/
function xml2Obj (oXMLDom) {
var oRObj = true;
if (oXMLDom.nodeType === 3) { // text
oRObj = oXMLDom.nodeValue.replace(/^\s+|\s+$/g, "");
@MorningZ
MorningZ / jQueryMobileBlock.js
Created July 22, 2011 21:10
Over riding jQuery Mobile's stock "loading" modal
/*
I was struggling with the fact that the "stock" jQuery Mobile "loading" message
allowed users to click on UI items around it...
so it's Mike Alsup's BlockUI to the rescue!
first include his blockui library from:
http://jquery.malsup.com/block/#download
*/
@MorningZ
MorningZ / flot-valueLabels-show-repeat
Last active December 13, 2015 18:08
Improvement to Leonardo Eloy's Flor Value Labels plugin
/**
* Value Labels Plugin for flot.
* https://github.com/leonardoeloy/flot-valuelabels
* http://wiki.github.com/leonardoeloy/flot-valuelabels/
*
* Using canvas.fillText instead of divs, which is better for printing - by Leonardo Eloy, March 2010.
* Tested with Flot 0.6 and JQuery 1.3.2.
*
* Original homepage: http://sites.google.com/site/petrsstuff/projects/flotvallab
* Released under the MIT license by Petr Blahos, December 2009.
@MorningZ
MorningZ / gist:5278101
Created March 30, 2013 19:52
jQueryMobile: Vertical Align listitem thumbnails
var jQM = {};
jQM.ResizeImage = function (img, maxWidth, maxHeight) {
maxHeight = maxHeight || maxWidth;
var srcWidth = img.width; var srcHeight = img.height;
var ratio = [maxWidth / srcWidth, maxHeight / srcHeight];
ratio = Math.min(ratio[0], ratio[1]);
return { width: parseInt(srcWidth * ratio), height: parseInt(srcHeight * ratio) };
};
Some hack-y code to spruce up the "new" layout of Team-Integra.net released at the end of May 2016.
*HOPEFULLY* this code won't be needed at all as I hope AutoGuide fixes issues that plague the site as is.
One huge unknown going into using this code: I have no idea what kind of bandwidth limits "imager.com" has,
so if a lot of people use this code, i'm not sure if at some point their site will stop serving the new
updated banner that I am hosting there, so we'll just see !! (I have a backup plan if it's a problem)
Two things are needed to use this code, CSS and JavaScript. If you don't know what those are, that's OK,
you don't really need to other than CSS is for look/design and JavaScript (JS) is for functionality.
Imports System.Net
Imports System.IO
Imports System.Net.Http
Imports System.Net.Http.Headers
Imports Newtonsoft.Json
''' <summary>Call the Dropbox API</summary>
''' <param name="i_AuthToken">Authentication Token string value</param>
''' <param name="i_Url">Url of Dropbox API endpoint</param>
''' <param name="i_Params">Dictionary of POST parameters (if needed)</param>
@MorningZ
MorningZ / FocusRSorg - Enahnce.txt
Last active October 9, 2018 18:34
Cleans up the "Active Threads" page of FocusRS.org. Pick and choose what threads to show/hide. Also changes the search in the navbar to use Google instead of the crappy vBulletin one.
/*
==========================
Compatible with:
==========================
- Desktop versions of Chrome, Firefox and Safari
==========================
Purpose:
==========================