Skip to content

Instantly share code, notes, and snippets.

@miwebguy
miwebguy / JSHints
Last active December 16, 2015 03:39
JSHints
//scroll id into view
bpid = ${processId};
if(bpid) {
var divid = document.getElementById('${processId}');
divid.scrollIntoView(true);
}
// TEST INPUT
var numbersOnly = /^\d+$/;
var decimalOnly = /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/;
@miwebguy
miwebguy / CSSHints.css
Last active December 16, 2015 03:39
CSSHints
//http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/
/**Custom Bullets on anything:*/
.S20_processing:before {
margin-right:2px;
padding:2px 6px;
content: "\2022 ";
color: yellow;
background-color:#ccc;
@miwebguy
miwebguy / DoxygenIni
Created April 12, 2013 12:30
DoxygenForPHPHings
Setting up Documentation for PHP Projects With Doxygen
Separate Subdirectory "doxygen" for docs
Index.php for doxygen:
auto directory
....
foreach($dirlist as $file) {
if ($file["type"] == "dir") {
@miwebguy
miwebguy / MooToolsHint.html
Created April 12, 2013 12:31
MooTools Hings
//Add keydown event to textbox
$('SKUSearch').addEvent('keydown', function(event) {
if(event.key == "enter") {
PPI.searchSku($('SkuForm'));
}
});
AJAX JSON
/** send the request */
new Request.JSON({
@miwebguy
miwebguy / PHPHints.php
Last active March 8, 2016 13:45
PHPHints
TRY/CATCH Format
try{
$_rs = $this->db->query($searchSQL, $_bind);
while ($_row = $this->db->fetch($_rs)){
# check the open date */
if (count(Core::datesBetween($_row["open_date"], date("Y-m-d"))) > 30) {
$_row["open_date_desc"] = "<b style='color: red'>"
.date("Y m/d",strtotime($_row["open_date"]))
@miwebguy
miwebguy / PHPTALHints.xhtml
Created April 12, 2013 12:33
PHPTalHints
PHPTAL HINTS
SELECTED ROW CLASS
<tr tal:attributes="class php: p.selected ? 'active' : NULL" >
SELECT OPTION SELECTED
<div tal:repeat="row rows">
<select name="value">
<option
tal:repeat="option options"
@miwebguy
miwebguy / application.php
Last active September 2, 2021 20:21
Old School Career Application form
<?php
/**
* @brief: job application for websites
* @created: 2010/07
*/
class JobApp
{
// config
@miwebguy
miwebguy / ButtonDelay.html
Last active August 29, 2015 13:57
MooTools Button Disable with delay
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script>
// single button
var subber = $('send');
subber.addEvent('click',function() {
subber.set('value','Submitting...').disabled = true;
(function() {
subber.disabled = false;
@miwebguy
miwebguy / Popup.html
Last active August 29, 2015 13:57
CSS & Tiny JS Popup, for Modern & Style Fallback IE8
<html>
<head>
<script type="text/javascript">
//<[CDATA[
window.addEvent('domready', function(){
// onload functions here
});
function overlay() {
el = document.getElementById("overlay");
@miwebguy
miwebguy / number-input-validation.html
Last active August 29, 2015 13:58
Use Pattern for Firefox input[type=number] support.
<input id="HoursEntry"
name="hours"
type="number"
pattern="[-+]?[0-9]*[.]?[0-9]+"
value="${hours}"
maxlength="5"
size="5" />