Skip to content

Instantly share code, notes, and snippets.

View UziTech's full-sized avatar
💭
Having Fun

Tony Brix UziTech

💭
Having Fun
View GitHub Profile
@UziTech
UziTech / trimAll.js
Created August 6, 2014 19:29
Trim all strings in an object
/**
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* This function trims all strings in an object or array
*
* This is useful when sending ajax requests
*
* var vals = {
@UziTech
UziTech / jquery.overlay.js
Last active February 11, 2016 20:25
jQuery simple overlay
/*
* DWTFYW License
* Author: Tony Brix, http://tonybrix.info
*
* Simple overlay with text/html in the center and a delayed cancel button
* Requires jQuery
*
* if cancelTimeDelay is < 0 then there is no cancel button
*
*/
@UziTech
UziTech / mysqlddate.js
Created August 8, 2014 04:14
Format date as mySQL date format
/**
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* Formats date in mm/dd/yyyy format as yyyy-mm-dd
*
* Returns false on failure
*
*/
@UziTech
UziTech / jquery.tooltiponoverflow.js
Created August 13, 2014 18:52
jquery plugin for showing tooltip on overflow
/**
* DWTFYW License
* Author: Tony Brix, http://tonybrix.info
*
* jquery plugin for showing tooltip on overflow
*
* USAGE:
*
* $("input, select").tooltipOnOverflow();
*
@UziTech
UziTech / searchLog.php
Last active August 29, 2015 14:05
Show logs from a file that matches a regular expression
<?php
/**
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* Show logs from a file that matches a regular expression. Matches multiline records.
* @param string $file The file to search
* @param string $search [optional] A string or regular expression to match; default = ""
@UziTech
UziTech / sendPost.php
Last active August 29, 2015 14:06
Send POST request to a webpage from php and return the response
<?php
/**
* Author: Tony Brix, http://tonybrix.info
*
* Send POST request to a webpage from php and return the response.
* @param string $url The url of the webpage you would like to send the request to.
* @param array $data The post data to send with the request.
* @return string The response of the request
*/
function sendPost($url, $data) {
@UziTech
UziTech / jquery.selectMultiple.js
Created November 21, 2014 07:25
HTML Select multiple without ctrl key
/**
* DWTFYW License
* Author: Tony Brix, http://tonybrix.info
*
* Set all multiple select elements to allow selecting multiple without using the ctrl key
*
*/
(function($){
$.fn.selectMultiple = function(){
return this.mousedown(function(e){
@UziTech
UziTech / getSearchTerms.js
Last active August 3, 2018 16:18
Get search terms
/**
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* Example:
* positive terms -----------V-----------V---------V-------V-----------------------V
* console.log(getSearchTerms("this -is 'a string' '-with' positive -'and negative' terms"));
* negative terms ----------------^-------------------------------------^
* Result:
@UziTech
UziTech / swapImage.js
Created March 13, 2015 21:57
jQuery plugin to swap new image after it loads. Useful if you want to load low res image first then swap with high res after it loads.
/*
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* Swap an image after it loads. Useful if you want to load low res image first then swap with high res after it loads.
*/
(function ($) {
$.fn.swapImage = function (img) {
var $this = this;
@UziTech
UziTech / jquery.isOver.js
Created March 13, 2015 22:03
jQuery plugin to check if a point on the page is within an element.
/*
* DWTFYW License
*
* Author: Tony Brix, http://tonybrix.info
*
* Check if a point is within an element.
* Useful for mouseover on absolutely positioned overlapping elements.
*
* Example:
* $(document).mousemove(function(e){