Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / miva-address-autocomplete.js
Created August 28, 2015 01:30
Miva - Address AutoComplete
var mvGAAC = {
init: function(){
$.getScript('//cdnjs.cloudflare.com/ajax/libs/geocomplete/1.6.5/jquery.geocomplete.min.js', mvGAAC.loaded);
},
loaded: function(){
$('.js-geocomplete-input')
.geocomplete()
.bind('geocode:result', mvGAAC.result);
},
result: function(event, result){
@steveosoule
steveosoule / miva-json-encoding.html
Created January 30, 2014 17:30
Miva Outputting JSON
<mvt:item name="toolkit" param="headeroutput|Content-Type|application/json" />
<mvt:item name="powrsrch" param="picklist|10" />
<mvt:if expr="l.settings:picklist">
[
<mvt:foreach iterator="pick" array="picklist">
<mvt:item name="toolkit" param="json_encode|l.all_settings:pick:term|l.all_settings:pick:term" />
<mvt:if expr="pos1 EQ 1">
{"term": ""}
<mvt:else>
,{"term": ""}
@steveosoule
steveosoule / select-html-text-with-javascript.html
Created January 30, 2014 23:25
Select HTML Text With JavaScript
<!-- FROM: http://us5.campaign-archive1.com/?u=ea228d7061e8bbfa8639666ad&id=c53c1e7832&e=ff0570c0b6 -->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<input value="Web Tools Weekly" id="textField">
@steveosoule
steveosoule / php-process-access-log.php
Created March 25, 2014 18:40
Process Traffic & Data Usage from Server Access Log
<?
// process_file("sample.txt");
process_file("access_log.txt");
function process_file($file = 'sample.txt')
{
// Declare Variables
$total_bytes = 0;
$graphic_bytes = 0;
$line_count = 0;
@steveosoule
steveosoule / htaccess-gzip-compression.text
Created March 25, 2014 18:58
.htaccess Gzip Compression
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
@steveosoule
steveosoule / css-vertically-align-element.css
Created March 25, 2014 19:01
CSS Vertically Align Element
/* http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@steveosoule
steveosoule / sass-vertical-align-mixin.scss
Created March 25, 2014 19:02
SASS Vertical Align Mixin
/* http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.element p {
@steveosoule
steveosoule / using-full-screen-mode.html
Created March 25, 2014 19:04
Using Full Screen Mode
<!-- https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode -->
<video controls id="myvideo">
<source src="somevideo.webm"></source>
<source src="somevideo.mp4"></source>
</video>
<script>
// We can put that video into fullscreen mode with script like this:
var elem = document.getElementById("myvideo");
if (elem.requestFullscreen) {
elem.requestFullscreen();
@steveosoule
steveosoule / listrak-newsletter-subsribe.html
Created March 25, 2014 19:05
Listrak Newsletter Subscribe
<!-- Listrak Professional Services - Subscribe-->
<script type="text/javascript">
_ltk.Subscriber.List = "Prod_Reg";
_ltk.Subscriber.Email = "Email Address Goes Here";
_ltk.Subscriber.Profile.Add("CheckBox.Source.Product Registrations", "on");
_ltk.Subscriber.Submit();
</script>
@steveosoule
steveosoule / full-text-search-css.html
Created March 25, 2014 19:05
Full Text search using CSS selectors to filter results
<!-- FROM: http://redotheweb.com/2013/05/15/client-side-full-text-search-in-css.html -->
<input type="text" placeholder="search" id="search">
<style id="search_style"></style>
<script type="text/javascript">
var searchStyle = document.getElementById('search_style');
document.getElementById('search').addEventListener('input', function() {
if (!this.value) {
searchStyle.innerHTML = "";
return;
}