View php-bootstrap-alert-helper-function.php
<?
// @type: string - [success, info, warning, danger]
// @message: string - content of alert
// @dismisable: boolean
// returns alert HTML
function html_alert($type, $message, $dismisable){
$alert = '';
$alert_class = 'alert';
if ( $type ) $alert_class += ' alert-'.$type;
View codeiginiter-smart-model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// FROM: http://www.thephpcode.com/blog/view/a-smart-codeigniter-model.html
class MY_Model extends CI_Model {
public $table;
public function __construct()
{
parent::__construct();
// $this->table = get_Class($this);
View _.debounce.js
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
var debounce = function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
View miva-variant-basket-item-replacement-with-fix-for-skipped-products.xml
<mvt:comment>
| ------------------------------------------------
| Variant Basket Item Replacement for Upsold Variants
| ------------------------------------------------
</mvt:comment>
<mvt:foreach iterator="item" array="basket:items">
<mvt:assign name="l.settings:item:options_count" value="miva_array_elements( l.settings:item:options )" />
<mvt:comment>
View StrangerThings.ino
// https://gist.github.com/steveosoule/f9d98b58ae666bce6a6752cefa2d11aa
// https://www.arduino.cc/reference/en/
// http://www.instructables.com/id/Arduino-Based-Stranger-Things-Lights/
// https://github.com/FastLED/FastLED
/**
* GLOBAL CONFIGURATION
**/
#include <FastLED.h>
View print-friendly-css.css
@media print {
* {
background: none !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
/* Images, vectors and such */
filter: Gray(); /* IE4-8: depreciated */
filter: url('desaturate.svg#grayscale'); /* SVG version for IE10, Firefox, Safari 5 and Opera */
View ad-blocked-mvga-overrides.js
/**
If Google Analytics does not load (add-blocking, network issues, etc.),
Then we need to disable the MVGA tracking functions and let the forms/links submit normally.
*/
$(window).on('load', function add_ga_failsafes(){
if( typeof ga !== 'undefined' && typeof ga.create !== 'undefined' ){
return;
}
MVGA_Tracker.prototype.List_AddToBasketSubmit = function(e){};
MVGA_Tracker.prototype.RemoveFromBasketForms = function(e){};
View wordpress-custom-post-types.php
<?
// FROM: http://www.webdesignerdepot.com/2014/10/how-to-take-your-wordpress-sites-to-the-next-level-with-custom-post-types/
// Append the following code to WordPress's "functions.php" file
add_action( 'init', 'register_movie' );
function register_movie() {
$labels = array(
View wget-crawl-script.sh
#!/bin/sh
# wget --mirror --adjust-extension --page-requisites --execute robots=off --wait=30 --rand om-wait --convert-links --user-agent=Mozilla http://www.example.com
### V1
# wget \
# --recursive \
# --no-clobber \
# --page-requisites \
# --html-extension \
View README.md

jquery.getScriptCached.js

jQuery's $.getScript function is a quick and easy way to include external JavaScript files into a website. However, its default implimentation will not cache the script file for the client.

The following information describes how you can itilize cached versions of $.getScript

Usage

  1. Include jquery, if it's not already.